Building a GRE Vocabulary Memorization System with LLMs: A Technical Practice

    This article walks through the engineering of a GRE vocabulary memorization system, from data modeling and version-controlled wordlist updates to LLM-generated mnemonic stories and spaced-repetition scheduling. It covers schema design, revision auditing, prompt constraints, hallucination guards, caching, cost control, and the metrics used to evaluate whether contextual mnemonics actually improve retention.

    1. The Real Bottleneck in GRE Vocabulary Prep

    The verbal section of the GRE (Graduate Record Examinations) demands a far larger vocabulary than typical English tests, and most candidates need to master more than three thousand high-frequency words. The pain point, however, is not whether a wordlist exists. It is three structural problems:

    1. Mismatch between the forgetting curve and review cadence. The Ebbinghaus forgetting curve shows that newly learned material is lost fastest within the first 24 hours, yet most printed wordbooks are ordered alphabetically and cannot support automatically resurfacing a word at its forgetting point.
    2. Isolated word forms lack semantic anchors. There is no retrievable link between a word’s spelling and its meaning, so recall has to be rebuilt from scratch, which raises cognitive load.
    3. Wordlists drift away from the exam. Topic distribution and word recurrence in exam material shift over time, and a static list becomes unreliable after two or three years, producing the “studied but not tested, tested but not studied” gap.

    A complete digital system therefore has to engineer four stages: selection, ordering, mnemonic support, and review. The sections below follow that order.

    2. Data Modeling the Lexicon: From Plain Text to Computable Structure

    A plain text wordlist cannot support sorting, filtering, or personalized recommendation, so the first step is turning it into structured data. A minimal viable model:

    1. {
    2. "word": "abate",
    3. "phonetic": "/əˈbeɪt/",
    4. "senses": [
    5. {"pos": "v.", "cn": "减弱;缓和", "en": "to become less intense"}
    6. ],
    7. "freq_rank": 412,
    8. "freq_band": "high",
    9. "tags": ["high-frequency", "verb", "abstract concept"],
    10. "etymology": "Latin ad- + battere (to beat)",
    11. "difficulty": 0.63,
    12. "version": "2026"
    13. }

    Key fields:

    • freq_rank: exam frequency rank, the primary key for sorting and filtering. Sorted descending, it puts the most frequently tested words first.
    • difficulty: derived from historical answer accuracy, used for adaptive question selection so that already-mastered words do not receive excessive exposure.
    • version: wordbook version, supporting incremental updates and migration of user progress.

    For storage, the lexicon itself is structured data that is read often and written rarely, which suits a relational database with an index on freq_rank. Mnemonic stories and example sentences are large in size and accessed infrequently, so they fit better in object storage, with the database holding only reference paths. Separating metadata from content keeps wordlist filtering in the millisecond range while preventing large fields from slowing down the main query.

    3. Frequency Ordering and Version Governance for Wordlist Changes

    A new edition of a wordbook typically does two things: adds roughly 970 high-frequency words and removes roughly 227 low-frequency simple words. In engineering terms this is a data version migration, and it forces three questions:

    1. Will removals break user progress? Never delete physically. Words dropped from the high-frequency set should be flagged deprecated rather than removed; existing study records are preserved and the word is simply down-weighted in the review queue.
    2. How do new words get inserted without disturbing the existing order? Ordering does not depend on array indexes but on the freq_rank field, so inserting a word is just adding a record with no full-table re-sort.
    3. How do you trace the impact of a given change? Maintain a revision table that records batch differences:
    1. CREATE TABLE wordlist_revision (
    2. batch_id VARCHAR(32) NOT NULL,
    3. word VARCHAR(64) NOT NULL,
    4. change_type ENUM('added','deprecated','reranked') NOT NULL,
    5. old_rank INT,
    6. new_rank INT,
    7. created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    8. PRIMARY KEY (batch_id, word)
    9. );

    With this table you can audit diffs, run a gradual rollout (pushing the new wordlist to a subset of users first), and roll back in one step. For a test-prep product, the credibility of the wordlist is a core asset, so every change must be explainable and reversible.

    4. How AI Mnemonics Work: Engineering Episodic Memory

    The technical core of AI mnemonics is not mysterious: combine a large model’s language generation ability with the cognitive principle of episodic memory, generating a short story with characters, setting, and conflict for each word. The abstract word form is thus attached to a concrete situation, and recall works backward from situational cues to the meaning.

    4.1 Prompt Design

    Prompt quality directly determines mnemonic quality. A usable system prompt has four parts: role constraints, language constraints, content constraints, and format constraints.

    1. You are a vocabulary mnemonic writer for GRE candidates.
    2. Requirements:
    3. 1. Write a 60-120 word English story around the given word, with a complete plot and a concrete setting;
    4. 2. The target word must appear at least twice, and the final sentence must state its Chinese meaning;
    5. 3. Reuse vocabulary the learner has already mastered; no more than 10% unfamiliar words;
    6. 4. Output strict JSON: {"story": "...", "gloss": "...", "cue": "..."};
    7. 5. Do not fabricate information that conflicts with the etymology or the definition.

    Requirement 3 matters most: a story packed with unfamiliar words adds to the memory burden and defeats the purpose. Requirement 4 makes downstream rendering of cards straightforward, with no need to re-parse natural language.

    4.2 Reliability and Cost Control

    LLM output is stochastic, so production needs guardrails:

    • Definition validation: compare the generated gloss against the standard definition in the lexicon; on mismatch, discard the result and fall back to a template example sentence so hallucinations never contaminate study material.
    • Cache reuse: use word + prompt_version as the cache key and persist results, so the same word is never generated twice. This cuts cost and keeps the story stable for a given user.
    • Batching and asynchrony: with a wordlist in the thousands, a full warm-up should be smoothed through a message queue, with consumers calling the model in batches and writing to object storage while the frontend fetches on demand.
    • Fallback strategy: when the model service is unavailable, fall back to locally generated “root breakdown plus classic example sentence” content so the feature stays available.

    A minimal implementation on the calling side:

    1. def build_messages(word: str, mastered: list[str]) -> list[dict]:
    2. return [
    3. {"role": "system", "content": SYSTEM_PROMPT},
    4. {"role": "user", "content": f"word={word}; mastered_sample={mastered[:50]}"}
    5. ]
    6. def generate_mnemonic(word, mastered, cache):
    7. key = f"{word}:{PROMPT_VERSION}"
    8. if (hit := cache.get(key)):
    9. return hit
    10. resp = llm.chat(build_messages(word, mastered), response_format="json")
    11. data = validate(resp, word) # validate definition and format
    12. cache.setex(key, 86400 * 30, data) # long-lived cache
    13. return data

    5. Review Scheduling: Closing the Loop on Mnemonics

    Generating a story only solves first-time memorization; long-term retention still depends on a scheduling algorithm. A common engineering choice is a simplified spaced-repetition approach (SM-2 style), maintaining a memory state per word:

    1. def schedule(state, quality: int):
    2. # quality: 0-5, the learner's self-rating of this recall
    3. if quality < 3:
    4. state.repetitions = 0
    5. state.interval = 1
    6. else:
    7. state.repetitions += 1
    8. state.interval = round(state.interval * state.ease)
    9. state.ease = max(1.3, state.ease + 0.1 - (5 - quality) * 0.08)
    10. state.due_at = today() + timedelta(days=state.interval)
    11. return state

    Combining freq_rank with the scheduler yields a strategy that fits the exam more closely: high-frequency words are dequeued first when due, low-frequency words may be deferred, and words with high difficulty get a shorter initial interval. Exam frequency and the forgetting curve then jointly determine review order instead of a single dimension driving everything.

    6. Measuring Impact and Iterating

    Once the feature ships, evaluation needs quantifiable metrics across at least three layers:

    • Memory layer: one-week retention per word, average recall time, distribution of self-rated quality.
    • Content layer: mnemonic story adoption rate, skip/regenerate click rate, definition validation failure rate (a proxy for model hallucination).
    • System layer: P95 latency of the generation pipeline, cache hit rate, cost per generation.

    Iteration runs as an A/B experiment: the control group uses template example sentences, the treatment group uses LLM stories, and retention is compared across the same set of words. Only a significant retention lift shows that contextual mnemonics genuinely work, rather than merely looking more interesting.

    7. Summary

    The technical priorities of a GRE high-frequency vocabulary system come down to four points: structure the lexicon and drive ordering from the frequency field; make wordlist additions and removals auditable and reversible through a revision table; control hallucination in LLM mnemonics with strict prompt constraints plus output validation, and control cost with caching and asynchronous queues; and finally, use spaced-repetition scheduling to connect mnemonic content to long-term memory. The design depends on no vendor-specific capability, and model calls, storage, queues, and monitoring can all be carried by general-purpose cloud product categories, which makes it reproducible across different technology stacks.