| { |
| "task": { |
| "id": "case_13", |
| "name": "token_trend_analysis", |
| "summary": "Analyzes the trend [increasing, decreasing, constant] of numeric tokens.", |
| "examples": [ |
| { |
| "input": [ |
| "BOS", |
| 1, |
| 1, |
| 0, |
| 0, |
| 1, |
| 1, |
| 0, |
| 0, |
| 0 |
| ], |
| "output": [ |
| "BOS", |
| "constant", |
| "decreasing", |
| "constant", |
| "increasing", |
| "constant", |
| "decreasing", |
| "constant", |
| "constant", |
| null |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 2, |
| 2, |
| 0, |
| 2, |
| 0, |
| 2, |
| 2, |
| 0, |
| 0 |
| ], |
| "output": [ |
| "BOS", |
| "constant", |
| "decreasing", |
| "increasing", |
| "decreasing", |
| "increasing", |
| "constant", |
| "decreasing", |
| "constant", |
| null |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 2, |
| 0, |
| 2, |
| 2, |
| 0, |
| 0, |
| 2, |
| 1, |
| 2 |
| ], |
| "output": [ |
| "BOS", |
| "decreasing", |
| "increasing", |
| "constant", |
| "decreasing", |
| "constant", |
| "increasing", |
| "decreasing", |
| "increasing", |
| null |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 2, |
| 2, |
| 2, |
| 1, |
| 2, |
| 1, |
| 1, |
| 2, |
| 1 |
| ], |
| "output": [ |
| "BOS", |
| "constant", |
| "constant", |
| "decreasing", |
| "increasing", |
| "decreasing", |
| "constant", |
| "increasing", |
| "decreasing", |
| null |
| ] |
| }, |
| { |
| "input": [ |
| "BOS", |
| 2, |
| 2, |
| 2, |
| 0, |
| 2, |
| 1, |
| 0, |
| 1, |
| 1 |
| ], |
| "output": [ |
| "BOS", |
| "constant", |
| "constant", |
| "decreasing", |
| "increasing", |
| "decreasing", |
| "decreasing", |
| "increasing", |
| "constant", |
| null |
| ] |
| } |
| ], |
| "is_categorical": true |
| }, |
| "program": "select_off_by_offset = rasp.Select[rasp.indices, rasp.indices, lambda k,q: q == k + offset]\nnext_token = rasp.Aggregate[select_off_by_offset, sop, default=None].named[\"shift_by(-1)\"]\ntrend_analysis = rasp.SequenceMap[second_part_fn, sop, next_token]\nreturn trend_analysis", |
| "components": [ |
| { |
| "id": "L0H0_ATTN", |
| "hook": "blocks.0.attn.hook_result[0]", |
| "role": { |
| "tag": "ROUTER", |
| "note": "Shifts the sequence to provide each position with the next token (and pads the end)." |
| }, |
| "rasp_vars": [ |
| "next_token" |
| ], |
| "labels": [ |
| "shift_by(-1)_2" |
| ] |
| }, |
| { |
| "id": "L0_MLP", |
| "hook": "blocks.0.mlp.hook_post", |
| "role": { |
| "tag": "COMBINER", |
| "note": "Compares the current token with the next token and outputs the trend class." |
| }, |
| "rasp_vars": [ |
| "trend_analysis" |
| ], |
| "labels": [ |
| "sequence_map_1" |
| ] |
| } |
| ] |
| } |
|
|