Back to Education
Deep Learning Specialization · Sequence Models

Character-Level Language Model

A character-level RNN built from scratch to generate dinosaur names and Shakespeare-style text one character at a time.

RNN from scratchOne-hot character modelingGradient clippingSamplingText generation

What this project is about

This project builds a language model at the smallest text unit: characters. It learns the next-character distribution and samples new dinosaur names, then extends the idea to Shakespeare-style generation.

Implementation focus

The main idea was sequence generation from scratch: forward pass, backward pass, gradient clipping, sampling, and how loss improvements gradually produce more realistic text.

Key results and artifacts

  • Dinosaur corpus: 19,909 characters
  • Vocabulary: 27 characters
  • Default training loop: 35,000 iterations
  • Shakespeare section: 31,412 examples

What I learned

The learning was foundational: language generation begins with predicting the next token, even when the token is only a character.

What this project proves in my learning path.

A character-level RNN built from scratch to generate dinosaur names and Shakespeare-style text one character at a time. The milestone is included because it shows a complete learning unit: a problem, a data representation, an implementation path, measurable outputs, and a lesson that later connects to larger AI systems.

Input layerordered sequences of text, audio, dates, or musical events
Model layerrecurrent or attention-based sequence model
Evaluation layertests, metrics, plots, or qualitative output
Artifact layerclassification, generation, alignment, or trigger probabilities
Problem framing

What I was trying to solve

This page is not just a lab description. It explains how I transformed the assignment idea into an engineering story: what the model receives, what it optimizes, what output it should produce, and how the result can be inspected.

Implementation

What I coded or assembled

The implementation focus was the mechanism behind the result: functions, model blocks, training logic, preprocessing, evaluation, and the small technical details that make the notebook work rather than only look correct.

Concepts

Core concepts

RNN from scratchOne-hot character modelingGradient clippingSamplingText generation

These tags show the technical ideas this milestone added to my toolkit.

Learning result

What changed after it

The learning was foundational: language generation begins with predicting the next token, even when the token is only a character.

Important outputs and evidence

  • Dinosaur corpus: 19,909 characters
  • Vocabulary: 27 characters
  • Default training loop: 35,000 iterations
  • Shakespeare section: 31,412 examples

How I would explain it in an interview

I would describe this milestone by starting from the data representation, then explain the model or algorithm, then show what was measured. The important part is not only the final number; it is the ability to reason about why the method works, what assumptions it makes, and what limitations should be improved next.