Task dossier

Algorithm Induction from Demonstration

T000119T000119-algorithm-induction-from-demonstrationSmoke testedWeb preview availableUpdated Aug 30, 2026

This task is a screen-based adaptation of the two algorithm-induction experiments reported by Pitt et al. (2026). Participants infer late...

Algorithm Induction from Demonstration flow diagram
Algorithm Induction from Demonstration 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/T000119-algorithm-induction-from-demonstration.git
cd T000119-algorithm-induction-from-demonstration
# Follow the README for local setup and run steps

Algorithm Induction from Demonstration

FieldValue
NameAlgorithm Induction from Demonstration
TaskBeacon IDT000119
Versionv0.1.0
Date Updated2026-08-29
PsyFlow VersionCurrent workspace runtime
PsychoPy VersionCurrent workspace runtime
ModalityBehavioral
Variantbaseline
AcquisitionBehavioral
LanguageChinese
RuntimePsyFlow / PsychoPy
TAPS contractv0.2.0
Releasev0.1.0
Primary sourcePitt et al. (2026), Nature Communications

1. Task Overview

This task is a screen-based adaptation of the two algorithm-induction experiments reported by Pitt et al. (2026). Participants infer latent sequential structure from very sparse demonstrations without being told the rule and without trial feedback. The task first uses colored-ball actions directed to two bins, then tests transfer of abstract structure across new geometric symbols, larger alphabets, and new sequence lengths.

The main constructs are program induction, pattern learning, relational abstraction, and out-of-distribution generalization. Primary behavioral outputs are the ordered response sequence, position-wise accuracy, exact-match status, edit distance to a canonical rule-consistent sequence, use of all offered symbols, completion latency, and timeout status. Raw ordered responses remain the primary record because the source paper allows multiple structurally plausible responses in some generalization conditions.

Source: Children use algorithm induction to discover patterns in data.

2. Task Flow

Task Flow

Block-Level Flow

  1. General instructions explain observation, continuation, pointer input, and the absence of rule text or correctness feedback.
  2. Action-sequence block: three trials in the published order Sort, Double, Hitch.
  3. Pattern-generalization block: six sample patterns in the published order Alternate, Mirror.4, Hitch, Mirror.6, Split, Grow. Each sample receives Copy, Translate, Integrate, and Extend in that order.
  4. The task writes trial-level CSV data plus a compact JSON session summary, then shows a neutral completion screen.

Trial-Level Flow

Action trials show four demonstration steps, one at a time. The participant then sees a compact demonstration strip and concrete action tiles arranged under labeled left/right bin columns. They click eight actions in sequence within 50 seconds. Sort alternates single red/blue balls, Double additionally alternates one/two-ball groups, and Hitch adds a black companion ball. No response feedback is shown.

Pattern trials keep a colored-shape sample row visible while showing a fixed-length empty response board and a clickable response alphabet. Copy preserves alphabet and length; Translate changes all response objects; Integrate adds an unfamiliar symbol and lengthens the board; Extend uses the translated alphabet on a 12-position board. The participant fills the ordered response by clicking symbols, with no correctness feedback.

Controller Logic

There is no adaptive controller. src/utils.py precompiles the fixed source-aligned schedule and participant-level action counterbalancing before BlockUnit execution. Starting color, color-to-side assignment, and Double color-to-number assignment are deterministic from the task seed and participant ID.

Other logic

The physical tabletop response is adapted to PsyFlow's framework-owned capture_pointer_sequence(...). A click on an action tile represents choosing the shown ball group and placing it in the tile's labeled bin. The human profile includes 27 logical trials; QA and simulation profiles shorten only pattern coverage while retaining all mechanisms.

3. Configuration Summary

a. Subject Info

SettingValue
Subject IDThree-digit integer, 101-999
Seed policySame within participant
InputMouse or touch pointer; Space to continue non-trial screens

b. Window Settings

SettingValue
Resolution1280 × 800 px
UnitsPixels
BackgroundWarm off-white (#F7F3E8)
FullscreenDisabled by default

c. Stimuli

FamilyImplementation
Colored balls and binsPsychoPy circle and rectangle primitives
Sample/response blocksTriangle, diamond, square, circle, trapezoid, and pentagon primitives
TextChinese, SimHei, explicit non-overlapping anchors
External assetsNone

d. Timing

PhaseHuman profile
Each action demonstration step1.0 s
Action continuation window50.0 s
Pattern response window60.0 s (inferred digital deadline)
Inter-trial interval0.5 s

Conditions

ConditionParticipant-visible manipulation
SortAlternate single colored balls across bins
DoubleAlternate color, bin, and one/two-ball quantity
HitchA black ball accompanies each alternating colored ball
CopySame alphabet and same length
TranslateNew alphabet, same abstract sequence and length
IntegrateOne added symbol type and a longer board
ExtendTranslated alphabet on a 12-position board

Triggers

CodeEvent
1 / 99Experiment start / end
10 / 90Block start / end
20Action demonstration onset
30Action response onset
31 / 32 / 33Pointer selection / response complete / timeout
40Pattern response onset
50Inter-trial interval onset

Adaptive controller

None. All trial specifications are deterministic and auditable before presentation.

Run commands

python main.py human --config config/config.yaml
python main.py qa --config config/config_qa.yaml
python main.py sim --config config/config_scripted_sim.yaml
python main.py sim --config config/config_sampler_sim.yaml

4. Methods (for academic publication)

Participants completed a two-block pointer-response task adapted from Pitt et al. (2026). In the first block, each of three action algorithms was demonstrated for four steps. Sort alternated two ball colors and response bins; Double additionally alternated group size; Hitch paired a third-color ball with every primary colored ball. Immediately after each demonstration, participants selected eight concrete action tiles in order during a 50-second response window. Starting color and feature assignments were counterbalanced deterministically across participant identifiers.

In the second block, participants viewed six source patterns encoded by the abstract structures ABAB, ABBA, ABCB, ABCCBA, AAABBB, and ABBCCC, presented as colored geometric objects. For each source pattern, participants completed four conditions: Copy (same alphabet and length), Translate (new colored-shape alphabet, same length), Integrate (one additional symbol type and a longer response board), and Extend (translated alphabet, 12 positions). Source patterns remained visible throughout response. No trial-level informative feedback was provided.

Responses were stored as ordered symbol/action sequences. Descriptive outcomes included exact match to a deterministic canonical continuation, position-wise accuracy, Levenshtein edit distance, completion latency, timeout, and full-alphabet use. The canonical score supports automated QA and descriptive analysis; raw response sequences should be retained for source-paper-compatible modeling because multiple algorithmically regular responses can be theoretically meaningful.

Reproducibility and source alignment

The action order, four-step demonstration, 50-second action window, six sample structures, four generalization conditions, Integrate lengths, 12-position Extend board, and no-feedback policy come directly from the primary paper. The fixed eight-action digital response length, 1-second digital demonstration pacing, 60-second pattern deadline, and exact colored-shape assignment where the paper provides only examples are documented as adaptations or inferences in references/parameter_mapping.md and references/task_logic_audit.md.

Outputs

  • Human data: outputs/human/
  • QA data and reports: outputs/qa/
  • Scripted simulation: outputs/sim/
  • Sampler simulation: outputs/sim_sampler/
  • Evidence and audit trail: references/

License

MIT. The task uses only code-defined PsychoPy primitives and includes no third-party media assets.