Zing Forum

Reading

Building an AI Word Guesser with Neuroevolution and Genetic Algorithms: A CUDA-Accelerated Wordle Solver Project

An open-source project combining neural networks, genetic algorithms, and CUDA acceleration, exploring how AI can learn to play Wordle via neuroevolution and demonstrating the full implementation process from model architecture design to GPU parallel training.

neuroevolutiongenetic algorithmCUDAWordleneural networkGPU accelerationreinforcement learninggame AIdeep learning
Published 2026-05-22 09:12Recent activity 2026-05-22 09:18Estimated read 5 min
Building an AI Word Guesser with Neuroevolution and Genetic Algorithms: A CUDA-Accelerated Wordle Solver Project
1

Section 01

Building a CUDA-Accelerated Wordle AI with Neuroevolution and Genetic Algorithms: Project Core Guide

This article introduces an open-source Wordle solver project that combines neural networks, genetic algorithms, and CUDA acceleration. The project aims to build an AI model capable of learning Wordle strategies while practicing CUDA programming, neural network design, and genetic algorithm implementation. Its core value lies in integrating classic evolutionary computing with modern GPU technology, providing an effective solution for discrete action scenarios, and serving as a practical example of complete machine learning system development.

2

Section 02

Project Background and Motivation

Wordle became popular in 2021; its rules are simple but require complex probabilistic reasoning. Developer Sam Bee previously implemented a deterministic algorithm solver using Go, while this new project shifts to a learning-based model: the goal is to build a neural network that can learn Wordle strategies, while deeply practicing CUDA programming, neural network architecture design, and genetic algorithms.

3

Section 03

Neural Network Strategy Model Architecture

The core of the model is mapping game states to guessed words. Input encoding layer: up to 5 rounds of history (each round includes the guessed word and color feedback, converted into a 64-dimensional vector; empty rounds are zero vectors) + new game scalar (1/0), total input dimension is 321. The backbone network is an MLP: 256-neuron layer + 128-neuron layer. The output head generates a 64-dimensional strategy vector.

4

Section 04

Output Embedding and Action Selection Mechanism

There are about 4739 candidate words in Wordle; directly outputting neurons would lead to an explosion in parameter count. Solution: each candidate word learns a 64-dimensional embedding (26-dimensional fixed letter occurrence count +38-dimensional trainable). The strategy vector and embedding vector are dot-producted for scoring, and the highest score is selected as the guessed word, significantly reducing the parameter count.

5

Section 05

CUDA-Accelerated Genetic Algorithm Training

Training uses genetic algorithms to evolve NN weights, with the entire process parallelized on GPU: population management uses genotype flat tables, and offspring overflow to the host when memory is insufficient; fitness evaluation adopts a spatial sharding strategy; action space grows incrementally (from common words to rare words); recombination, mutation, and fitness evaluation are all executed on CUDA devices to reduce data transmission overhead.

6

Section 06

Training Process and Technical Highlights

Three-stage training: 1. GA evolves the initial model; 2. Curriculum learning expands the action space; 3. Planned RL fine-tuning. Technical highlights: state encoding preserves game information while controlling dimensions; cellular automaton-style parallel evaluation is suitable for GPU; complete engineering practices (documentation, Makefile, Docker, interactive inference, multiple test modes).

7

Section 07

Development Environment, Usage Methods, and Future Outlook

Environment requirements: CMake 3.22+, CUDA 13.1 compatible toolkit; Docker configuration simplifies dependencies. Basic commands: make configure/build/test/play. Future plans: improve RL integration, expand to other word games, enhance model performance.