Task dossier

Artificial Grammar Learning Task

T000082T000082-artificial-grammar-learning-taskDraftWeb preview availableUpdated Aug 23, 2026

Classic Reber finite-state artificial grammar learning paradigm

Artificial Grammar Learning Task flow diagram
Artificial Grammar Learning Task flow diagram
Preview path
This task ships with a matched HTML companion so the browser preview can stay aligned to the canonical local repository.
Quick start
Clone locally, then follow the README for install and run instructions.
git clone https://github.com/TaskBeacon/T000082-artificial-grammar-learning-task.git
cd T000082-artificial-grammar-learning-task
# Follow the README for local setup and run steps

Artificial Grammar Learning Task

FieldValue
NameArtificial Grammar Learning Task
Versionv0.1.0
URL / Repositoryhttps://github.com/TaskBeacon/T000082-artificial-grammar-learning-task
Short DescriptionClassic Reber finite-state artificial grammar learning paradigm
Created ByTaskBeacon
Date Updated2026-08-01
PsyFlow Version0.3.0
PsychoPy Version2025.1.1
ModalityBehavior
LanguageChinese instructions; canonical Latin-letter stimuli
Voice NameDisabled

1. Task Overview

This task measures implicit acquisition of sequential regularities. Participants first memorize and reproduce strings generated by the classic Reber finite-state grammar without being told that a grammar exists. After a five-minute interval, they learn that the training strings followed a complex rule system and classify novel grammatical and one-position-violation strings using intuitive judgments. Primary outcomes are classification accuracy and response time; training reproduction accuracy is retained as a manipulation/engagement measure.

2. Task Flow

Task Flow

Block-Level Flow

StepDescription
Load modemain.py loads the human, QA, scripted-sim, or sampler-sim YAML profile while preserving one task implementation.
Initialize runtimeCollect or inject subject_id, construct TaskSettings, initialize trigger runtime, window, keyboard, and StimBank.
Training instructionstraining_instruction teaches immediate letter-string reproduction but does not reveal the grammar.
Training blockgenerate_training_schedule(...) creates two independently shuffled passes through 16 fixed grammatical strings (32 logical trials).
Interphase intervaldelay_fixation is shown for 300 s between acquisition and classification (delay_start/delay_end).
Test instructionstest_instruction reveals that the strings followed a complex system and teaches F = conforms, J = does not conform, emphasizing intuitive judgment.
Classification blockgenerate_test_schedule(...) shuffles 16 novel grammatical and 16 paired one-position-violation strings. No feedback is provided.
Summary and exportDisplay completion, accuracy, and mean RT; export one CSV row per training or test trial.

Trial-Level Flow

Trial TypeStepDuration / ResponseVisible Stimulus and Logic
TrainingStudy string3.0 sletter_string: one centered uppercase P/T/S/X/V string.
TrainingImmediate reproduction10.0 s per keystrokerecall_prompt and recall_typed; P/T/S/X/V append, Backspace deletes, Enter submits.
TrainingRetry0.75 s, when neededretry_notice; an incorrect reproduction is re-presented, up to three attempts total.
TrainingITI0.5 sNeutral fixation; no grammar or correctness feedback.
TestGrammaticality classification10.0 stest_string above spatially separated classify_left (F, conforms) and classify_right (J, does not conform).
TestITI0.5 sNeutral fixation; test trials never show correctness feedback.

Controller Logic

FeatureDescription
Grammar validationis_grammatical(...) walks the explicit Reber transition table and accepts only strings ending in the terminal state.
Training scheduleA custom item scheduler is required because two complete passes through a fixed pool must be preserved while shuffling each pass independently.
Test scheduleThe scheduler validates disjoint positive pools, 50/50 grammaticality, one substituted character per negative item, and the recorded violation index before shuffling.
DeterminismTraining and test orders derive from PsyFlow block seeds; trial factors are fully formed before run_trial(...).

Other Logic

FeatureDescription
Training correctnessExact submitted string equality determines recall_correct; training attempts and timeouts are retained.
Test correctnessF is correct for grammatical items and J for nongrammatical items; timeouts are missing (correct = null).
Summary metricsCompleted trials, overall accuracy, grammatical hit rate, nongrammatical correct-rejection rate, and mean response time are computed from test rows.
SimulationThe scripted responder reproduces strings exactly and classifies correctly; the sampler independently controls recall and classification accuracy.

3. Configuration Summary

Settings below are from config/config.yaml.

a. Subject Info

FieldMeaning
subject_idThree-digit participant identifier (101-999) in human mode; deterministic ID in QA/sim.

b. Window Settings

ParameterValue
Size1280 x 800
Unitsdegrees of visual angle (deg)
Background#F5F5F2
Fullscreenfalse
Monitor geometry35.5 cm width, 57 cm viewing distance

c. Stimuli

NameTypeDescription
training_instructiontextChinese incidental-learning and reproduction instructions.
letter_stringtextCentered monospaced grammatical training string.
recall_prompttextChinese prompt and editing/submission key reminder.
recall_typedtextParticipant's current monospaced reproduction.
retry_noticetextNeutral re-presentation notice.
delay_fixationtextFixation during the five-minute interval.
test_instructiontextGrammar disclosure, intuitive judgment instruction, and F/J mapping.
test_stringtextNovel grammatical or one-position-violation string.
classify_left / classify_righttextSpatially separated conforms/not-conforms options.
fixationtextNeutral inter-trial fixation.
good_byetextTest completion and performance summary.

d. Timing

PhaseDuration
Training study string3.0 s
Recall response10.0 s per key event
Retry notice0.75 s
Training-test interval300.0 s
Classification response10.0 s maximum
ITI0.5 s

e. Triggers

EventCode
experiment_start / experiment_end1 / 99
training_block_start / training_block_end10 / 19
training_string20
recall_entry / recall_key / recall_timeout / recall_retry21 / 22 / 23 / 24
delay_start / delay_end30 / 31
test_block_start / test_block_end40 / 49
test_grammatical / test_nongrammatical50 / 51
classify_conforms / classify_violates / classification_timeout60 / 61 / 62
iti70

4. Methods (for academic publication)

Participants completed a computerized behavioral artificial grammar learning task based on the classic Reber paradigm (Knowlton & Squire, 1994, 1996). During incidental acquisition, each of 16 unique letter strings generated by a finite-state grammar over P, T, S, X, and V was displayed centrally for 3 s. Participants immediately reproduced the string using the keyboard. Incorrectly reproduced strings could be presented up to three times, and the complete 16-item set was administered twice in independently randomized orders. Participants were not informed of the grammar during this phase, and no grammatical-rule feedback was provided.

After a 300-s fixation interval, participants were told that all acquisition strings followed a complex rule system. They were instructed to rely on intuition rather than explicitly derive the rules and classified 32 novel strings using a two-alternative forced choice (F = conforms, J = does not conform). Half of the test strings were grammatical and half were paired strings containing exactly one substituted character that caused a finite-state violation. Positive training and test pools were disjoint, test order was randomized, the response deadline was 10 s, and no trial-level feedback was shown.

The concrete stimulus pools and their grammatical status were validated against an explicit Reber finite-state transition table before runtime. Custom scheduling was limited to preserving fixed item identities, disjoint pools, two complete training passes, and a balanced test; it did not adapt to participant behavior. Trial-level data included stimulus identity, grammaticality, paired source and violation position, reproduction response/attempts, classification response and RT, and correctness. The principal dependent measures were grammaticality classification accuracy, grammatical hit rate, nongrammatical correct-rejection rate, and mean classification response time.