{ "task": { "id": "case_15", "name": "double_minus_index", "summary": "Returns each token multiplied by two and subtracted by its index.", "examples": [ { "input": [ "BOS", 2, 4, 3, 2 ], "output": [ "BOS", 4, 7, 4, 1 ] }, { "input": [ "BOS", 4, 1, 3, 1 ], "output": [ "BOS", 8, 1, 4, -1 ] }, { "input": [ "BOS", 3, 4, 2, 4 ], "output": [ "BOS", 6, 7, 2, 5 ] }, { "input": [ "BOS", 3, 4, 0, 3 ], "output": [ "BOS", 6, 7, -2, 3 ] }, { "input": [ "BOS", 4, 1, 2, 2 ], "output": [ "BOS", 8, 1, 2, 1 ] } ], "is_categorical": true }, "program": "values, *sops = sops; for sop in sops: values = rasp.SequenceMap(lambda x, y: (*x, y) if isinstance(x, tuple) else (x, y), values, sop); return rasp.Map(lambda args: f(*args), values)", "components": [ { "id": "L0_MLP", "hook": "blocks.0.mlp.hook_post", "role": { "tag": "COMBINER", "note": "Builds an intermediate representation that packages multiple per-position inputs together so they can be processed as a single combined object downstream." }, "rasp_vars": [ "values_tuple_stage_1" ], "labels": [ "sequence_map_3" ] }, { "id": "L1_MLP", "hook": "blocks.1.mlp.hook_post", "role": { "tag": "COMBINER", "note": "Extends the combined per-position representation by incorporating the position index, forming the final set of arguments needed for the arithmetic step." }, "rasp_vars": [ "values_tuple_stage_2" ], "labels": [ "sequence_map_2" ] }, { "id": "L2_MLP", "hook": "blocks.2.mlp.hook_post", "role": { "tag": "MAPPER", "note": "Computes the final per-position arithmetic from the bundled arguments (equivalent to doubling the token value and subtracting the index)." }, "rasp_vars": [ "output" ], "labels": [ "map_1" ] } ] }