N-Back Task
Version: v1 (current)
Overview
The N-Back task is a continuous performance measure of working memory capacity and executive control. Participants view a sequence of stimuli (letters, numbers, or shapes) and must decide whether each item matches the one presented N positions earlier in the sequence.
For example, in a 2-back task viewing the sequence "A-B-A-C-C", the participant would respond "match" on the third trial (A matches 2 positions back) and the fifth trial (C matches 2 positions back), but "no match" on trials 1, 2, and 4.
The N-back load can be manipulated (1-back, 2-back, 3-back, etc.) to vary cognitive demand, making this a flexible tool for assessing working memory capacity across different populations.
Scientific Background
The N-back task has become a gold-standard measure of working memory in both cognitive and clinical research:
- Kirchner, W.K. (1958). Age differences in short-term retention of rapidly changing information. Journal of Experimental Psychology, 55(4), 352-358. (Original N-back task)
- Owen, A.M., et al. (2005). N-back working memory paradigm: A meta-analysis of normative functional neuroimaging studies. Human Brain Mapping, 25(1), 46-59.
- Jaeggi, S.M., et al. (2008). Improving fluid intelligence with training on working memory. Proceedings of the National Academy of Sciences, 105(19), 6829-6833.
The task requires three core processes:
- Encoding: Store the current stimulus in working memory
- Updating: Continuously refresh the memory trace as new items appear
- Comparison: Match current item against the item N positions back
Performance typically declines as N increases, with most adults showing ceiling effects at 1-back, moderate accuracy at 2-back, and substantial difficulty at 3-back and beyond.
Why Researchers Use This Task
- Working memory assessment: Measures both storage and executive control components
- Load manipulation: Systematic variation of N allows dose-response analysis
- Training studies: Used to assess working memory plasticity and transfer effects
- Clinical research: Sensitive to ADHD, schizophrenia, aging, and other conditions affecting executive function
- Neuroimaging: Robust activation in dorsolateral prefrontal cortex and parietal cortex
- Signal detection analysis: Provides hits, misses, false alarms, and correct rejections for d-prime calculation
Task Parameters
N-Back Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| Nback N | number | 1 | The N value (how many positions back to match); typically 1-3 |
| Nback Time Based | boolean | True | If True, trials auto-advance; if False, participant clicks to advance |
Visual Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| Nback Font Size (px) | number | 72 | Font size for stimuli (8-400) |
| Nback Font Color | string | '#111827' | Stimulus text color (hex) |
| Nback Background Color | string | '#ffffff' | Background color (hex) |
Button Labels
| Parameter | Type | Default | Description |
|---|---|---|---|
| Nback Match Label | string | 'Match' | Label for "match" button |
| Nback No Match Label | string | 'No match' | Label for "no match" button |
Practice Trials
| Parameter | Type | Default | Description |
|---|---|---|---|
| Nback Practice Enabled | boolean | False | Enable practice trials with visual feedback |
| Nback Practice Trials | array | [] | Array of practice trial configurations |
Trial Configuration
Each trial is defined in the Trials spreadsheet with the following columns:
| Column | Description | Example |
|---|---|---|
| str | The stimulus to display | A, B, 5, X |
| fixation_ms | Fixation cross duration | 500 |
| stimulus_ms | Stimulus display duration | 2000 |
| block | Optional grouping label | 1-back, 2-back, Practice |
Important: The task automatically determines which trials are "targets" (matches) based on the N value and sequence position. You don't need to specify is_target in the spreadsheet because the task calculates this dynamically.
Example Trial Sequence (2-back)
| str | fixation_ms | stimulus_ms | block | Computed: Is Target? |
|-----|-------------|-------------|--------|---------------------|
| A | 500 | 2000 | 2-back | No (first trial) |
| B | 500 | 2000 | 2-back | No (second trial) |
| A | 500 | 2000 | 2-back | YES (matches trial 1)|
| C | 500 | 2000 | 2-back | No |
| B | 500 | 2000 | 2-back | YES (matches trial 2)|
| A | 500 | 2000 | 2-back | YES (matches trial 3)|
Target rate: Typically 30-40% of trials should be targets. The task will compute this automatically based on your sequence.
Participant Experience
Trial Sequence
- Main Instructions: Explains the N-back rule (e.g., "Press Match if the letter matches the one from 2 trials ago")
- (Optional) Practice Instructions: If practice enabled
- (Optional) Practice Trials: With visual feedback (green checkmark for correct, red X for incorrect)
- (Optional) Trials Instructions: Shown before main trials begin
- Main Trials: Each trial follows this sequence:
- Fixation cross (
+) appears (if fixation_ms > 0) - Stimulus appears
- Participant decides: "Match" or "No match"
- Press corresponding button or wait for auto-advance
- Next trial begins
- Fixation cross (
Response Modes
Time-based mode (nback_time_based: true):
- Participant must respond within stimulus duration
- Trial advances automatically after
stimulus_ms - Non-responses counted as "no match"
Button-based mode (nback_time_based: false):
- Participant clicks either "Match" or "No match" button
- Trial advances after button press
- Allows self-paced responding
Data Output
Markers and Responses
Markers (stimulus_shown):
{
"type": "stimulus_shown",
"ts": "2024-01-01T00:00:06.000Z",
"hr": 6234.56,
"data": {
"trial_index": 3,
"stimulus_id": "nback_0_3",
"stimulus_value": "A",
"n_value": 2,
"is_target": true,
"block": "2-back"
}
}
Response Data:
{
"trial_index": 3,
"stimulus_id": "nback_0_3",
"source": "button",
"stimulus_value": "A",
"n_value": 2,
"is_target": true,
"response_value": "match",
"correct": true,
"signal_detection": "hit",
"latency_ms": 672,
"ts": "2024-01-01T00:00:06.672Z",
"hr": 6906.56
}
Signal detection outcomes:
hit: Correctly responded "match" to a targetmiss: Failed to respond "match" to a targetfalse_alarm: Incorrectly responded "match" to a non-targetcorrect_rejection: Correctly responded "no match" to a non-targetno_response: No response made (timeout)
Summary Artifact
A JSON file (nback_summary_<taskIndex>.json) with signal detection metrics:
{
"task_kind": "nback",
"n_value": 2,
"total_trials": 60,
"overall": {
"accuracy": 0.85,
"mean_rt_ms": 658,
"signal_detection": {
"hits": 18,
"misses": 4,
"false_alarms": 5,
"correct_rejections": 33,
"hit_rate": 0.818,
"false_alarm_rate": 0.132,
"d_prime": 1.85,
"criterion": -0.12
}
},
"trials": [ /* per-trial data */ ]
}
Key metrics:
d_prime: Sensitivity (ability to discriminate targets from non-targets); higher is bettercriterion: Response bias (negative = liberal, positive = conservative)hit_rate: Proportion of targets correctly identifiedfalse_alarm_rate: Proportion of non-targets incorrectly identified as targets
Design Recommendations
N Value Selection
| N Value | Difficulty | Typical Accuracy | Use Case |
|---|---|---|---|
| 1-back | Easy | >90% | Children, clinical populations, ceiling control |
| 2-back | Moderate | 70-85% | Standard adult assessment |
| 3-back | Hard | 50-70% | High-functioning adults, training studies |
| 4-back+ | Very Hard | <50% | Expert populations, pushing limits |
Recommendation: Start with 2-back for most adult studies. Use 1-back for practice or populations with cognitive impairment.
Trial Count
Minimum for stable estimates:
- 60 trials total
- At least 20 target trials (matches)
- At least 40 non-target trials
Optimal:
- 100-120 trials total
- 30-40% target rate
- Multiple blocks with breaks
Stimulus Selection
Letters: Most common; use consonants to avoid acronyms (B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z)
Numbers: Alternative to letters; use 1-9 (avoid 0 which looks like O)
Shapes: For non-literate populations
Avoid:
- Sequences with obvious patterns (A-B-A-B-A-B)
- Too many consecutive targets (no more than 2 in a row)
- Sequences where every N position is the same stimulus
Timing Guidelines
| Parameter | Standard | Fast | Slow |
|---|---|---|---|
| Fixation (ms) | 500ms | 200ms | 800ms |
| Stimulus (ms) | 2000ms | 1500ms | 3000ms |
Total trial duration = fixation_ms + stimulus_ms (e.g., 2500ms standard)
Practice Trials
Include 12-20 practice trials:
- Use same N value as main task
- Mix targets and non-targets (30-40% targets)
- Provide feedback so participants understand the rule
- Consider starting with easier (1-back) practice, then moving to target N
Common Issues and Solutions
Low Accuracy (<60%)
Possible causes:
- N value too high for population
- Insufficient practice
- Stimulus duration too short
- Participants don't understand the rule
Solutions:
- Reduce N value (try 1-back or 2-back)
- Extend practice with clearer feedback
- Increase
stimulus_msto 3000ms - Revise instructions to emphasize "positions back" concept
High False Alarm Rate
Problem: Participants responding "match" too often
Possible causes:
- Misunderstanding task (comparing to any previous item)
- Response bias toward "match"
- Lure trials (items that appeared N+1 or N-1 back)
Solutions:
- Emphasize exact N-back rule in instructions
- Show examples in practice with explicit feedback
- Review sequence design for unintended lures
No Practice Mode
Problem: Participants struggle in main trials without feedback
Solution:
- Enable
nback_practice_enabled: true - Create practice sequence in
nback_practice_trialsspreadsheet - Use same stimuli and timing as main trials
- Ensure all participants complete practice before main task
Example Study Configurations
Standard 2-Back Assessment
- N = 2
- 100 trials (35 targets, 65 non-targets)
- Letters as stimuli (consonants only)
- 500ms fixation, 2000ms stimulus
- Time-based mode
- Practice: 20 trials with feedback
Load Manipulation Study
Within-subjects design with three blocks:
- Block 1: 1-back (40 trials)
- Block 2: 2-back (60 trials)
- Block 3: 3-back (60 trials)
Each block has separate practice (12 trials)
Clinical/Developmental Version
- N = 1 (easier)
- Longer stimulus duration (3000ms)
- Button-based mode (self-paced)
- Larger font (96px)
- Simple stimuli (numbers 1-5)
- Fewer trials (60 total)
- Extended practice (20 trials)
References
- Kirchner, W.K. (1958). Age differences in short-term retention of rapidly changing information. Journal of Experimental Psychology, 55(4), 352-358.
- Owen, A.M., McMillan, K.M., Laird, A.R., & Bullmore, E. (2005). N-back working memory paradigm: A meta-analysis of normative functional neuroimaging studies. Human Brain Mapping, 25(1), 46-59.
- Jaeggi, S.M., Buschkuehl, M., Jonides, J., & Perrig, W.J. (2008). Improving fluid intelligence with training on working memory. Proceedings of the National Academy of Sciences, 105(19), 6829-6833.
- Kane, M.J., Conway, A.R., Miura, T.K., & Colflesh, G.J. (2007). Working memory, attention control, and the N-back task: A question of construct validity. Journal of Experimental Psychology: Learning, Memory, and Cognition, 33(3), 615-622.