A-maze

Code
jspsych-maze (plugin)
maze-distractor-generator
maze-demos
Maze (older)

Current tools
Distractor generation (Hugging Face models)
Running A-maze in jsPsych
A-maze for kids
A-maze in other languages

Demos
All demos
Kid-friendly reading
Sentences with RT graph
Sentences without redo
Short vignettes
Natural Stories story

Background
What is A-maze?
Papers using A-maze
An argument for 'redo' mode
Adding a delay to 'redo' mode
Experiment design
Parameter considerations

Older tools
Original distractor generation (Boyce et al. 2020; Boyce & Levy 2023)
Install instructions
Basic use
Parameters
Advanced options
Ibex
Using Ibex for Maze
Hosting an Ibex-Maze server

A-maze in other languages

The distractor generator is set up for English. Nothing in the method is English-specific, though. A-maze needs three ingredients, and for another language you supply your own version of each:

  1. A list of possible distractor words. These should be real, common, inoffensive words that participants will recognize. Computer dictionaries can help, but usually need cutting (abbreviations, proper nouns, swear words, sensitive topics).
  2. Word frequencies, to draw candidates that match the correct word in length and frequency.
  3. A language model that can say how surprising a word is in context.

What to change in the generator

Set three things in your parameters file:

language: "fr"                      # a wordfreq language code
include_words: "french_words.txt"   # candidate distractors, one per line
model: "<a French or multilingual Hugging Face model>"

language is a wordfreq language code; wordfreq has frequency data for about 40 languages. Frequencies for both the candidate distractors and the real words come from that language, so candidates are matched to your words on length and frequency. An unknown code is an error.

include_words is required outside English; there is no default word list for other languages. Candidates must be all-lowercase letters (accented letters are fine), which drops proper nouns and abbreviations. English’s curated_word_list.txt took a fair amount of hand-filtering (offensive words, sensitive topics). Budget for that, especially if participants are children. Use exclude_words for words to never use.

model can be any Hugging Face causal or masked model (backend). Use one trained on your language, either monolingual or a multilingual model with good coverage of it. It’s worth checking that it gives sensible surprisals on a few of your sentences before generating everything (get_surprisal.py).

If you need different rules for which words are allowed, copy wordfreq_dict in wordfreq_distractor.py and set dictionary_class to your class.

Things to think about

Studies building on A-maze have been run outside English, for example in Mandarin Chinese (Hao, Fuchs, & Vasishth, 2025; see papers using A-maze). If you adapt the generator for another language, contributions to maze-distractor-generator are welcome.