ml

Next Word Prediction

LSTM language model that predicts the next word in a sequence

Next Word Prediction

Tech Stack

PythonPytorchLSTM

About This Project

Overview

A PyTorch LSTM model trained to predict the next word given a sequence of input text — a core language-modeling exercise in sequential prediction.

Motivation

Next-word prediction is the simplest possible entry point into language modeling, and I wanted to build one from scratch to understand the mechanics underneath tools like autocomplete.

Lessons Learned

Training stability was more finicky than expected — gradient clipping and learning rate scheduling made a bigger difference to convergence than I anticipated for a model this small.