From 453b2ff7871740a8eb1eb5576f1d07636b4c60b5 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 15:58:43 +0800 Subject: [PATCH 1/7] Screen deeper LiSA sharing with complete autoregressive answers --- crossqkv/lisa_full_answer.py | 209 ++ crossqkv/lisa_full_answer_train.py | 206 ++ crossqkv/lisa_generate.py | 127 ++ crossqkv/lisa_tail.py | 39 +- crossqkv/lisa_train.py | 5 +- docs/LISA_FULL_ANSWER_PROTOCOL.md | 37 + functional/model.py | 7 +- .../lisa-full-answer-reproduction/code.sha256 | 9 + .../lisa-full-answer-reproduction/frozen.json | 1775 +++++++++++++++++ .../preflight.json | 5 + tests/test_lisa_full_answer.py | 43 + tests/test_lisa_tail.py | 12 + tests/test_lisa_train.py | 14 + 13 files changed, 2474 insertions(+), 14 deletions(-) create mode 100644 crossqkv/lisa_full_answer.py create mode 100644 crossqkv/lisa_full_answer_train.py create mode 100644 crossqkv/lisa_generate.py create mode 100644 docs/LISA_FULL_ANSWER_PROTOCOL.md create mode 100644 results/lisa-full-answer-reproduction/code.sha256 create mode 100644 results/lisa-full-answer-reproduction/frozen.json create mode 100644 results/lisa-full-answer-reproduction/preflight.json create mode 100644 tests/test_lisa_full_answer.py diff --git a/crossqkv/lisa_full_answer.py b/crossqkv/lisa_full_answer.py new file mode 100644 index 0000000..4afadc1 --- /dev/null +++ b/crossqkv/lisa_full_answer.py @@ -0,0 +1,209 @@ +"""Freeze numeric tasks and screen the effect of sharing on complete answers.""" +import argparse +from hashlib import sha256 +import json +from pathlib import Path +import random +import re + +import torch +from tokenizers import Tokenizer + +from crossqkv.lisa_effect_screen import WORDS +from crossqkv.lisa_generate import GenerationDecoder, generate +from crossqkv.lisa_tail import TorchTail +from functional.model import StreamingLM +from functional.run import write_json + + +TASKS = ('lookup', 'latest', 'addition', 'count') +SEEDS = {'screen': 621001, 'fit': 621002, 'validation': 621003, 'test': 621004} +COUNTS = {'screen': 8, 'fit': 24, 'validation': 8, 'test': 32} +SCHEDULES = {'native': (), 'direct_3': (15, 19, 23), + 'direct_4': (11, 15, 19, 23), 'direct_5': (7, 11, 15, 19, 23)} +STOP_TEXT = ('<|im_end|>', '<|endoftext|>') +MAX_NEW_TOKENS = 24 +PROCESS_SWAP_LIMIT_KIB = 384 * 1024 + + +def fixed_problems(): + output = {} + for split, seed in SEEDS.items(): + rng = random.Random(seed) + rows = [] + for task in TASKS: + for i in range(COUNTS[split]): + if task in ('lookup', 'latest'): + keys = rng.sample(WORDS, 12) + values = rng.sample(range(20, 100), 12) + pos = rng.randrange(len(keys)) + key = keys[pos] + if task == 'latest': + later = rng.randrange(1, len(keys)) + earlier = rng.randrange(later) + keys[earlier] = keys[later] + pos, key = later, keys[later] + schedule = ', '.join(f'{k}={v}' for k, v in zip(keys, values)) + descriptor = 'last recorded' if task == 'latest' else 'recorded' + question = f'Records in time order: {schedule}.\nWhat is the {descriptor} number for {key}?' + answer = values[pos] + elif task == 'addition': + a, b = sorted((rng.randint(20, 89), rng.randint(20, 89))) + question = f'What is {a} plus {b}?' + answer = a + b + else: + first, second = rng.sample(WORDS, 2) + answer = rng.randint(10, 15) + values = [first] * answer + [second] * rng.randint(3, 9) + rng.shuffle(values) + question = f"Items: {', '.join(values)}.\nHow many items are exactly '{first}'?" + rows.append({'id': f'{split}-{task}-{i:03}', 'task': task, + 'question': question, 'answer': answer}) + output[split] = rows + # Arithmetic questions can repeat across independently seeded splits. + # Keep the first generated occurrence and fill duplicates with new disjoint sums. + used = set() + replacement = random.Random(621005) + for rows in output.values(): + for row in rows: + while row['task'] == 'addition' and row['question'] in used: + a, b = sorted((replacement.randint(20, 89), replacement.randint(20, 89))) + row.update(question=f'What is {a} plus {b}?', answer=a+b) + if row['question'] in used: + raise ValueError('Prompt repeated across the frozen set') + used.add(row['question']) + return output + + +def prompt(question): + return ('<|im_start|>user\n' + question + '\nReply with the integer and no other text.' + '<|im_end|>\n<|im_start|>assistant\n\n\n\n\n') + + +def final_integer(text): + # Only completed reasoning prefixes precede an answer. + text = re.sub(r'\A\s*(?:.*?\s*)+', '', text, flags=re.S).strip() + if '' in text or '' in text: + return None + match = re.fullmatch(r'(?:[Ff]inal answer:\s*|[Aa]nswer:\s*)?([+-]?\d+)\.?', text) + if not match: + match = re.search(r'(?:^|\n)\s*(?:[Ff]inal answer|[Aa]nswer):\s*([+-]?\d+)\.?\s*\Z', text) + return int(match[1]) if match else None + + +def grade(tokenizer, tokens, stop, expected): + whole = tokenizer.decode(tokens, skip_special_tokens=False) + body = tokenizer.decode(tokens[:-1] if stop == 'eos' else tokens, + skip_special_tokens=False) + value = final_integer(body) if stop == 'eos' else None + return {'tokens': tokens, 'response': whole, 'stop': stop, 'answer': value, + 'correct': value == expected} + + +def evaluate(model, tokenizer, examples, arms, adapters=None): + stop_ids = {tokenizer.token_to_id(text) for text in STOP_TEXT} + if None in stop_ids or len(stop_ids) != len(STOP_TEXT): + raise ValueError('Unexpected tokenizer stop tokens') + ids = [tokenizer.encode(prompt(x['question']), add_special_tokens=False).ids for x in examples] + expanded = [x for x in ids for _ in arms] + schedules = list(arms.values()) * len(examples) + predictions = iter(generate(model, expanded, schedules, stop_ids, MAX_NEW_TOKENS, adapters)) + return [{'id': x['id'], 'task': x['task'], 'gold': x['answer'], + 'arms': {mode: grade(tokenizer, *next(predictions), x['answer']) for mode in arms}} + for x in examples] + + +def summarize(rows): + results = {} + for task in TASKS: + group = [row for row in rows if row['task'] == task] + results[task] = {} + for name in SCHEDULES: + original_correct = lambda row: row['arms']['native']['correct'] + produced_wrong = lambda row: row['arms'][name]['answer'] is not None and not row['arms'][name]['correct'] + results[task][name] = { + 'n': len(group), + 'correct': sum(row['arms'][name]['correct'] for row in group), + 'unscored': sum(row['arms'][name]['answer'] is None for row in group), + 'native_correct_to_wrong_integer': [ + row['id'] for row in group if original_correct(row) and produced_wrong(row)], + } + return results + + +def choose(summary): + options = [] + for task, arms in summary.items(): + if arms['native']['correct'] >= 6: + for arm in ('direct_3', 'direct_4', 'direct_5'): + losses = arms[arm]['native_correct_to_wrong_integer'] + if len(losses) >= 2: + options.append((len(losses), arms['native']['correct'], + len(SCHEDULES[arm]), task, arm)) + if not options: + return None + _, _, _, task, arm = max(options) + return {'task': task, 'arm': arm, 'recipients': list(SCHEDULES[arm])} + + +def fingerprint(path): + return sha256(path.read_bytes()).hexdigest() + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--source', required=True, type=Path) + parser.add_argument('--out', required=True, type=Path) + parser.add_argument('--seconds', default=21600, type=int) + parser.add_argument('--batch-prompts', default=2, type=int, choices=(1, 2)) + parser.add_argument('--preflight', action='store_true') + args = parser.parse_args() + torch.set_num_threads(1) + args.out.mkdir(exist_ok=True) + files = {name: fingerprint(args.source/name) for name in + ('manifest.json', 'model_config.json', 'tokenizer.json')} + protocol = {'weights': files, 'schedules': SCHEDULES, 'cap': MAX_NEW_TOKENS, + 'stops': STOP_TEXT, 'batch_prompts': args.batch_prompts, + 'decode': 'full vocabulary greedy, closed thinking prefix'} + manifest = args.out/'frozen.json' + frozen = {'protocol': protocol, 'problems': fixed_problems()} + frozen = json.loads(json.dumps(frozen)) + if manifest.exists() and json.loads(manifest.read_text()) != frozen: + raise ValueError('Frozen protocol or prompts changed') + write_json(manifest, frozen) + model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()), + seconds=args.seconds, process_swap_limit_kib=PROCESS_SWAP_LIMIT_KIB) + tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json')) + examples = frozen['problems']['screen'] + if args.preflight: + ids = torch.tensor([tokenizer.encode(prompt(examples[0]['question']), + add_special_tokens=False).ids]) + hidden = torch.from_numpy(model.embedding(ids.numpy())) + with torch.no_grad(): + expected, _ = TorchTail(model, 0)(hidden, None, torch.tensor([ids.shape[1]]), + 'native', ()) + decoder = GenerationDecoder(model, [()], [0]) + decoder.advance(ids[:, :-2]) + actual = decoder.advance(ids[:, -2:]) + ref = expected[:, -2:] + torch.testing.assert_close(actual, ref, atol=8e-5, rtol=7e-5) + write_json(args.out/'preflight.json', {'prompt_id': examples[0]['id'], + 'prompt_tokens': ids.shape[1], 'tail_hidden_max_abs': float((actual-ref).abs().max())}) + return + path = args.out/'screen-rows.json' + rows = json.loads(path.read_text()) if path.exists() else [] + if [r['id'] for r in rows] != [x['id'] for x in examples[:len(rows)]]: + raise ValueError('Existing screen results do not match frozen prompts') + for start in range(len(rows), len(examples), args.batch_prompts): + rows.extend(evaluate(model, tokenizer, examples[start:start+args.batch_prompts], SCHEDULES)) + write_json(path, rows) + print('screen complete', len(rows), '/', len(examples), flush=True) + summary = summarize(rows) + write_json(args.out/'screen-summary.json', summary) + write_json(args.out/'selection.json', {'frozen_sha256': fingerprint(manifest), + 'screen_sha256': fingerprint(path), + 'chosen': choose(summary)}) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_full_answer_train.py b/crossqkv/lisa_full_answer_train.py new file mode 100644 index 0000000..4053d40 --- /dev/null +++ b/crossqkv/lisa_full_answer_train.py @@ -0,0 +1,206 @@ +"""Fit LiSA on a development-selected schedule, then evaluate fresh continuations.""" +import argparse +import json +from pathlib import Path + +import numpy as np +import torch +from tokenizers import Tokenizer + +from crossqkv.lisa_effect_audit import paired +from crossqkv.lisa_full_answer import (PROCESS_SWAP_LIMIT_KIB, SCHEDULES, STOP_TEXT, choose, evaluate, fingerprint, + prompt, summarize) +from crossqkv.lisa_tail import TorchTail, weight_chunks +from crossqkv.lisa_train import LearnableSharingAttention, huber_distillation, language_model_loss +from functional.model import PREFIX, StreamingLM +from functional.run import write_json + + +class FitCapture(TorchTail): + def norm(self, x, name, centered=True): + if name == f'layers.{self.sites[0]}.input_layernorm': + self.residual = x + return super().norm(x, name, centered) + + +def load_locked(source, screen): + fixed = screen/'frozen.json' + rows = screen/'screen-rows.json' + chosen = json.loads((screen/'selection.json').read_text()) + if (chosen['frozen_sha256'] != fingerprint(fixed) + or chosen['screen_sha256'] != fingerprint(rows)): + raise ValueError('Locked screening hashes do not match') + manifest = json.loads(fixed.read_text()) + screen_rows = json.loads(rows.read_text()) + expected = [(x['id'], x['task'], x['answer']) for x in manifest['problems']['screen']] + if [(x['id'], x['task'], x['gold']) for x in screen_rows] != expected: + raise ValueError('Screening did not evaluate the frozen development set') + expected_selection = choose(summarize(screen_rows)) + if expected_selection is None or chosen['chosen'] != expected_selection: + raise ValueError('Development screen did not produce a qualifying schedule') + for name, digest in manifest['protocol']['weights'].items(): + if fingerprint(source/name) != digest: + raise ValueError(f'Model input {name} changed') + return chosen, manifest + + +@torch.no_grad() +def capture(model, tokenizer, fit_examples, directory): + directory.mkdir(exist_ok=True) + teacher = FitCapture(model, 0) + teacher.sites = model.sites + for i, row in enumerate(fit_examples): + path = directory/f'{i:03}.npz' + if path.exists(): + continue + text = prompt(row['question']) + base = tokenizer.encode(text, add_special_tokens=False).ids + complete = tokenizer.encode(text + str(row['answer']) + STOP_TEXT[0], + add_special_tokens=False).ids + if complete[:len(base)] != base or len(complete) <= len(base): + raise ValueError('Answer did not tokenize as an extension of the frozen prompt') + ids = np.array([complete]) + model.guard() + hidden = torch.from_numpy(model.embedding(ids)) + _, side = teacher(hidden, None, torch.tensor([len(complete)]), 'native', ()) + pending = path.with_suffix('.tmp.npz') + np.savez(pending, ids=ids, start=[len(base)], residual=teacher.residual.numpy(), + donor=side[model.sites[0]-4][0].numpy(), + teacher=np.stack([side[i][0].numpy() for i in model.sites])) + pending.replace(path) + print('fit capture', i+1, '/', len(fit_examples), flush=True) + + +def checkpoint(path, obj): + pending = path.with_suffix('.tmp') + torch.save(obj, pending) + pending.replace(path) + + +def train(model, tokenizer, out, split, epochs, rank): + c = model.config + rope = c['rope_parameters'] + adapters = {i: LearnableSharingAttention(c['hidden_size'], c['num_attention_heads'], + c['num_key_value_heads'], rank, rope['rope_theta'], rope['partial_rotary_factor'], + bias=c.get('attention_bias', False)) for i in model.sites} + tail = TorchTail(model, model.sites[0], adapters) + optim = torch.optim.AdamW(tail.parameters(), lr=.0003, weight_decay=.1) + last = out/'resume.pt' + selected = out/'lisa.pt' + state = {'epoch': 0, 'steps': [], 'trace': [], 'best_correct': -1} + if last.exists(): + state = torch.load(last, weights_only=True, map_location='cpu') + tail.adapters.load_state_dict(state['parameters']) + optim.load_state_dict(state['optimizer']) + + embedding = model.tensors[PREFIX+'embed_tokens.weight'] + + def vocab(): + start = 0 + for w in weight_chunks(embedding, 0, embedding.shape[0], rows=1024): + yield start, w + start += len(w) + + paths = sorted((out/'fit-capture').glob('*.npz')) + for epoch in range(state['epoch'], epochs): + for path in paths[len(state['steps']):]: + with np.load(path, allow_pickle=False) as entry: + b = {key: torch.from_numpy(entry[key]) for key in entry.files} + lengths = torch.tensor([b['ids'].shape[1]]) + optim.zero_grad(set_to_none=True) + h, side = tail(b['residual'], b['donor'], lengths, 'lisa', model.sites) + kd = torch.stack([huber_distillation(side[i][0], t, lengths) + for i, t in zip(model.sites, b['teacher'])]).mean() + ce = language_model_loss(h, b['ids'], lengths, vocab, completion_starts=b['start']) + loss = .25*kd + .75*ce + loss.backward() + if any(p.grad is None or not torch.isfinite(p.grad).all() for p in tail.parameters()): + raise FloatingPointError('Nonfinite LiSA gradient') + optim.step() + state['steps'].append({'capture': path.name, 'huber': float(kd.detach()), + 'completion_ce': float(ce.detach())}) + checkpoint(last, {**state, 'parameters': tail.adapters.state_dict(), + 'optimizer': optim.state_dict()}) + print('fit epoch', epoch+1, 'step', len(state['steps']), '/', len(paths), flush=True) + val = [] + for start in range(0, len(split['validation']), 2): + val.extend(evaluate(model, tokenizer, split['validation'][start:start+2], + {'lisa': model.sites}, adapters)) + correct = sum(x['arms']['lisa']['correct'] for x in val) + if correct > state['best_correct']: + state['best_correct'] = correct + state['best_epoch'] = epoch+1 + state['best_parameters'] = { + name: param.detach().clone() for name, param in tail.adapters.state_dict().items() + } + state['trace'].append({'epoch': epoch+1, 'steps': state['steps'], 'validation': val}) + state['steps'] = [] + state['epoch'] = epoch+1 + checkpoint(last, {**state, 'parameters': tail.adapters.state_dict(), + 'optimizer': optim.state_dict()}) + write_json(out/'trace.json', {'selected_epoch': state['best_epoch'], 'epochs': state['trace']}) + checkpoint(selected, state['best_parameters']) + tail.adapters.load_state_dict(state['best_parameters']) + return adapters + + +def audit(rows): + correct = {name: np.array([r['arms'][name]['correct'] for r in rows]) + for name in ('native', 'direct', 'lisa')} + bad_value = [r for r in rows if r['arms']['native']['correct'] + and r['arms']['direct']['answer'] is not None and not r['arms']['direct']['correct']] + return {'n': len(rows), 'correct': {name: int(x.sum()) for name, x in correct.items()}, + 'substantive_loss_ids': [r['id'] for r in bad_value], + 'substantive_rescued_ids': [r['id'] for r in bad_value if r['arms']['lisa']['correct']], + 'unscored': {name: sum(r['arms'][name]['answer'] is None for r in rows) for name in correct}, + **paired(correct['native'], correct['direct'], correct['lisa'])} + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + for path in ('source', 'screen', 'out'): + p.add_argument('--'+path, type=Path, required=True) + p.add_argument('--epochs', type=int, default=2) + args = p.parse_args() + if args.epochs < 1: + p.error('--epochs must be positive') + torch.set_num_threads(1) + torch.manual_seed(621011) + locked, manifest = load_locked(args.source, args.screen) + selection = locked['chosen'] + sites = tuple(selection['recipients']) + if sites != SCHEDULES[selection['arm']]: + raise ValueError('Unexpected selected schedule') + spec = {'screen': locked, 'epochs': args.epochs, 'rank': 40, 'seed': 621011, + 'objective': '0.25 teacher attention Huber + 0.75 full-vocabulary completion CE'} + args.out.mkdir(exist_ok=True) + run = args.out/'train-spec.json' + if run.exists() and json.loads(run.read_text()) != spec: + raise ValueError('Cannot resume with a different experiment definition') + write_json(run, spec) + tasks = {name: [r for r in rows if r['task'] == selection['task']] + for name, rows in manifest['problems'].items()} + model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()), + seconds=86400, process_swap_limit_kib=PROCESS_SWAP_LIMIT_KIB) + model.sites = sites + tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json')) + capture(model, tokenizer, tasks['fit'], args.out/'fit-capture') + adapters = train(model, tokenizer, args.out, tasks, args.epochs, spec['rank']) + output = args.out/'test-items.json' + rows = json.loads(output.read_text()) if output.exists() else [] + if [r['id'] for r in rows] != [x['id'] for x in tasks['test'][:len(rows)]]: + raise ValueError('Test continuation does not match the frozen rows') + for start in range(len(rows), len(tasks['test']), 2): + batch = tasks['test'][start:start+2] + base = evaluate(model, tokenizer, batch, {'native': (), 'direct': sites}) + lisa = evaluate(model, tokenizer, batch, {'lisa': sites}, adapters) + for x, y in zip(base, lisa): + x['arms'].update(y['arms']) + rows.extend(base) + write_json(output, rows) + print('test complete', len(rows), '/', len(tasks['test']), flush=True) + write_json(args.out/'test-audit.json', audit(rows)) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_generate.py b/crossqkv/lisa_generate.py new file mode 100644 index 0000000..af1d634 --- /dev/null +++ b/crossqkv/lisa_generate.py @@ -0,0 +1,127 @@ +"""Cached autoregressive Qwen text generation for the LiSA comparisons.""" +import math + +import torch +from torch.nn import functional as F + +from crossqkv.lisa_tail import TorchTail, rotate, weight_chunks +from functional.model import PREFIX + + +class GenerationDecoder(TorchTail): + """Share the previous full-attention layer's actual scores per batch lane.""" + + def __init__(self, source, schedules, padding, adapters=None): + super().__init__(source, 0, adapters) + full = [i for i, kind in enumerate(self.c['layer_types']) if kind == 'full_attention'] + if (len(schedules) != len(padding) or not schedules + or any(set(sites) - set(full[1:]) for sites in schedules)): + raise ValueError('Recipients need an earlier full-attention layer') + if self.adapters and any(tuple(sites) != tuple(map(int, self.adapters)) for sites in schedules): + raise ValueError('LiSA decoding requires one shared schedule for the batch') + self.padding = torch.tensor(padding) + self.share = {i: torch.tensor([i in sites for sites in schedules])[:, None, None, None] + for i in set().union(*schedules)} + self.position = 0 + self.states = {} + + def attention_chunk(self, h, layer, positions, allowed, donor): + heads, kv, dim = (self.c[k] for k in + ('num_attention_heads', 'num_key_value_heads', 'head_dim')) + p = f'layers.{layer}.self_attn.' + adapter = self.adapters[str(layer)] if str(layer) in self.adapters else None + if adapter is None: + q, gate = self.linear(h, p+'q_proj').unflatten(-1, (heads, 2*dim)).chunk(2, -1) + k = self.linear(h, p+'k_proj').unflatten(-1, (kv, dim)) + rope = self.c['rope_parameters'] + q = rotate(self.norm(q, p+'q_norm'), rope['rope_theta'], + rope['partial_rotary_factor'], positions) + k = rotate(self.norm(k, p+'k_norm'), rope['rope_theta'], + rope['partial_rotary_factor'], positions) + else: + gate = self.gate_only(h, p) + q = adapter.rotate(adapter.q_proj(h).unflatten(-1, (heads, adapter.rank)), positions) + k = adapter.rotate(adapter.k_proj(h).unflatten(-1, (kv, adapter.rank)), positions) + v = self.linear(h, p+'v_proj').unflatten(-1, (kv, dim)) + if layer in self.states: + prior_k, prior_v = self.states[layer] + k = torch.cat((prior_k, k), dim=1) + v = torch.cat((prior_v, v), dim=1) + self.states[layer] = k, v + repeats = heads // kv + scores = torch.einsum('bthd,bshd->bhts', q, k.repeat_interleave(repeats, 2)) + scores = scores / math.sqrt(q.shape[-1]) + if adapter is not None: + both = torch.cat((scores, donor), dim=1).permute(0, 2, 3, 1) + scores = adapter.fuse(both).permute(0, 3, 1, 2) + elif layer in self.share: + scores = torch.where(self.share[layer], donor, scores) + weights = scores.masked_fill(~allowed, -torch.inf).softmax(dim=-1) + context = torch.einsum('bhts,bshd->bthd', weights, v.repeat_interleave(repeats, 2)) + return self.linear((context * gate.sigmoid()).flatten(-2), p+'o_proj'), scores + + @torch.no_grad() + def advance(self, ids): + """Consume a prompt or continuation and return the final-normalized states.""" + stop = self.position + ids.shape[1] + queries = torch.arange(self.position, stop) + keys = torch.arange(stop) + positions = (queries[None, :] - self.padding[:, None]).clamp_min(0) + q_valid = queries[None, :] >= self.padding[:, None] + k_valid = keys[None, :] >= self.padding[:, None] + allowed = (queries[:, None] >= keys)[None, None] & ( + k_valid[:, None, None, :] | ~q_valid[:, None, :, None]) + h = torch.from_numpy(self.source.embedding(ids.numpy())) * q_valid[..., None] + donor = None + for layer, kind in enumerate(self.c['layer_types']): + if hasattr(self.source, 'guard'): + self.source.guard() + p = f'layers.{layer}.' + n = self.norm(h, p+'input_layernorm') + if kind == 'full_attention': + out, donor = self.attention_chunk(n, layer, positions, allowed, donor) + else: + out, self.states[layer] = self.linear_attention_chunk(n, layer, self.states.get(layer)) + h = h + out + n = self.norm(h, p+'post_attention_layernorm') + activation = F.silu(self.linear(n, p+'mlp.gate_proj')) * self.linear(n, p+'mlp.up_proj') + h = h + self.linear(activation, p+'mlp.down_proj') + self.position = stop + return self.norm(h, 'norm') + + +def greedy_tokens(hidden, embedding): + """Take the argmax over the complete tied vocabulary in bounded blocks.""" + peak = hidden.new_full((len(hidden),), -torch.inf) + ids = torch.zeros(len(hidden), dtype=torch.long) + start = 0 + for weight in weight_chunks(embedding, 0, embedding.shape[0], rows=1024): + score, arg = F.linear(hidden, weight).max(dim=-1) + ids = torch.where(score > peak, arg + start, ids) + peak = torch.maximum(peak, score) + start += len(weight) + if not torch.isfinite(peak).all(): + raise FloatingPointError('Non-finite next-token score') + return ids + + +@torch.no_grad() +def generate(source, prompts, schedules, stop_tokens, max_new_tokens, adapters=None): + width = max(map(len, prompts)) + padding = [width - len(prompt) for prompt in prompts] + seed = torch.tensor([[0] * n + prompt for prompt, n in zip(prompts, padding)]) + decoder = GenerationDecoder(source, schedules, padding, adapters) + head = source.tensors[PREFIX+'embed_tokens.weight'] + state = decoder.advance(seed)[:, -1] + output = [[] for _ in prompts] + finished = [False] * len(prompts) + for step in range(max_new_tokens): + ids = greedy_tokens(state, head) + for row, token in enumerate(ids.tolist()): + if not finished[row]: + output[row].append(token) + finished[row] = token in stop_tokens + if all(finished) or step + 1 == max_new_tokens: + break + state = decoder.advance(ids[:, None])[:, -1] + return [(tokens, 'eos' if done else 'max_new_tokens') for tokens, done in zip(output, finished)] diff --git a/crossqkv/lisa_tail.py b/crossqkv/lisa_tail.py index 3b097d5..da17159 100644 --- a/crossqkv/lisa_tail.py +++ b/crossqkv/lisa_tail.py @@ -37,20 +37,23 @@ class FrozenLinear(torch.autograd.Function): return out, None, None, None -def rotate(x, theta, fraction): +def rotate(x, theta, fraction, positions=None): d = int(x.shape[-1] * fraction) inv = theta ** (-torch.arange(0, d, 2, dtype=x.dtype, device=x.device) / d) - phase = torch.arange(x.shape[1], dtype=x.dtype, device=x.device)[:, None] * inv - angle = torch.cat((phase, phase), dim=-1)[None, :, None, :] + if positions is None: + positions = torch.arange(x.shape[1], dtype=x.dtype, device=x.device)[None, :] + phase = positions[..., None] * inv + angle = torch.cat((phase, phase), dim=-1).unsqueeze(-2) a, b = x[..., :d].chunk(2, dim=-1) return torch.cat((x[..., :d] * angle.cos() + torch.cat((-b, a), -1) * angle.sin(), x[..., d:]), dim=-1) -def gated_delta(q, k, v, g, beta): +def gated_delta_chunk(q, k, v, g, beta, state=None): q = q * (q.square().sum(-1, keepdim=True) + 1e-6).rsqrt() / math.sqrt(q.shape[-1]) k = k * (k.square().sum(-1, keepdim=True) + 1e-6).rsqrt() - state = v.new_zeros(v.shape[0], v.shape[2], k.shape[-1], v.shape[-1]) + if state is None: + state = v.new_zeros(v.shape[0], v.shape[2], k.shape[-1], v.shape[-1]) rows = [] for i in range(v.shape[1]): qt, kt, vt = q[:, i], k[:, i], v[:, i] @@ -58,7 +61,11 @@ def gated_delta(q, k, v, g, beta): delta = (vt - (state * kt.unsqueeze(-1)).sum(-2)) * beta[:, i, :, None] state = state + kt.unsqueeze(-1) * delta.unsqueeze(-2) rows.append((state * qt.unsqueeze(-1)).sum(-2)) - return torch.stack(rows, dim=1) + return torch.stack(rows, dim=1), state + + +def gated_delta(q, k, v, g, beta): + return gated_delta_chunk(q, k, v, g, beta)[0] class TorchTail(nn.Module): @@ -133,14 +140,23 @@ class TorchTail(nn.Module): return self.linear(out.flatten(-2), name+'o_proj'), scores, native def linear_attention(self, x, layer): + return self.linear_attention_chunk(x, layer)[0] + + def linear_attention_chunk(self, x, layer, previous=None): p = f'layers.{layer}.linear_attn.' c = self.c kh, vh = c['linear_num_key_heads'], c['linear_num_value_heads'] kd, vd = c['linear_key_head_dim'], c['linear_value_head_dim'] projected = self.linear(x, p+'in_proj_qkv').transpose(1, 2) kernel = self.small(p+'conv1d.weight') - convolved = F.conv1d(projected, kernel, padding=kernel.shape[-1]-1, - groups=projected.shape[1])[..., :x.shape[1]] + history = kernel.shape[-1] - 1 + if previous is None: + projected = F.pad(projected, (history, 0)) + state = None + else: + prefix, state = previous + projected = torch.cat((prefix, projected), dim=-1) + convolved = F.conv1d(projected, kernel, groups=projected.shape[1]) q, k, v = F.silu(convolved.transpose(1, 2)).split((kh*kd, kh*kd, vh*vd), dim=-1) q = q.unflatten(-1, (kh, kd)).repeat_interleave(vh//kh, dim=2) k = k.unflatten(-1, (kh, kd)).repeat_interleave(vh//kh, dim=2) @@ -149,9 +165,10 @@ class TorchTail(nn.Module): beta = self.linear(x, p+'in_proj_b').sigmoid() a = self.linear(x, p+'in_proj_a') g = -self.small(p+'A_log').exp() * F.softplus(a + self.small(p+'dt_bias')) - out = gated_delta(q, k, v, g, beta) - return self.linear((self.norm(out, p+'norm', centered=False)*F.silu(gate)).flatten(-2), - p+'out_proj') + out, state = gated_delta_chunk(q, k, v, g, beta, state) + output = self.linear((self.norm(out, p+'norm', centered=False)*F.silu(gate)).flatten(-2), + p+'out_proj') + return output, (projected[..., projected.shape[-1]-history:].clone(), state) def forward(self, h, donor, lengths, mode, recipients, keep_teacher=False): side = {} diff --git a/crossqkv/lisa_train.py b/crossqkv/lisa_train.py index 2b0ff3b..3a63802 100644 --- a/crossqkv/lisa_train.py +++ b/crossqkv/lisa_train.py @@ -114,10 +114,13 @@ class _FrozenVocabularyCE(torch.autograd.Function): return grad_hidden * (gradient * weights[:, None] / weights.sum()), None, None, None -def language_model_loss(hidden, ids, lengths, vocabulary, answer_weight=1.0): +def language_model_loss(hidden, ids, lengths, vocabulary, answer_weight=1.0, + completion_starts=None): """Train on all valid next-token targets, avoiding padding and final positions.""" positions = torch.arange(ids.shape[1] - 1, device=ids.device) valid = positions[None, :] + 1 < lengths[:, None] + if completion_starts is not None: + valid = valid & (positions[None, :] + 1 >= completion_starts[:, None]) weights = torch.where(positions[None, :] + 2 == lengths[:, None], answer_weight, 1.0) return _FrozenVocabularyCE.apply(hidden[:, :-1][valid], ids[:, 1:][valid], weights[valid].to(dtype=hidden.dtype), vocabulary) diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md new file mode 100644 index 0000000..173c620 --- /dev/null +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -0,0 +1,37 @@ +# 完整答案评估下的 LiSA 共享实验 + +本轮在同一 Qwen3.5-2B 检查点上比较 3、4、5 个全注意力层接收共享分数的效果。上一轮发现首 token 命中的变化集中在 `` 和同一个选项。本轮要求模型从全词表生成完整的多 token 数值答案,逐题复核答案的数值。 + +## 开发筛选与冻结 + +从 0 开始编号。接收层分别为 `[15, 19, 23]`、`[11, 15, 19, 23]` 和 `[7, 11, 15, 19, 23]`。每个接收层使用本次前向中前一全注意力层实际输出的分数。接收端保留自身的 V、门控和输出投影。原模型与三个直接共享配置配对生成。 + +候选任务为表中数值查找、重复键最后值查找、两位数加法、重复项计数。固定生成器在运行筛选之前写出每类任务 8 道开发题、24 道训练题、8 道验证题和 32 道留出测试题。同一数值题跨数据划分去重,加法按交换律规范操作数。每个候选都要满足原模型至少答对 6/8 且至少 2 道原模型答对的题在直接共享下生成了错误整数。选择时依次比较数字错误数、原模型正确数和接收层数。完成了生成却没有可提取答案的情况单独记数。 + +使用检查点发布的单轮聊天模板和关闭 thinking 的生成前缀。所有配置从全词表逐 token 贪心生成,遇到回合结束或文本结束 token 停止,最多生成 24 tokens。主要指标要求已生成停止 token,并从整条答复提取完整整数。接受纯整数或明确的最终答案行,可去掉开头完整的 thinking 区块。原始 token、文本、停止原因和提取值都随结果存档。 [检查点聊天模板](https://huggingface.co/Qwen/Qwen3.5-2B/blob/15852e8c16360a2fea060d615a32b45270f8a8fc/chat_template.jinja) + +## LiSA 训练与测试 + +开发筛选完成后用固定哈希验证题集、共享配置、原模型和筛选数据。仅在存在达标配置时启动训练。冻结原模型,只训练两个线性层组成的注意力头融合和 rank 40 的低秩 Q/K。用原模型在同一训练序列上的因果注意力分数作为教师。损失为 0.25 倍 Huber 距离加 0.75 倍全词表交叉熵,交叉熵覆盖参考答案的所有 token 和结束 token。每个训练样本更新后保存优化器和模型状态。验证集上生成完整答案,按正确数选择两轮中的最佳检查点,同分选较早者。 + +最终对同一批留出题的原模型、直接共享、训练后的 LiSA 分别生成并保存完整回答。报告准确率、直接共享造成的数值错误、其中被 LiSA 恢复的题、新增错误和缺少可提取答案的情况。准确率差按题配对估计,另报告 McNemar 精确双侧检验。 + +## 运行命令 + +在已确认的远程 CPU 环境中,从源代码目录运行,使用独立输出目录。模型源目录需要包含上一轮实验使用的权重、配置、下载清单和 tokenizer。 + +```sh +export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 +PYTHON=venv/bin/python +SOURCE=runs/cpu-qwen35-2b +SCREEN=runs/NEW_FULL_ANSWER_SCREEN +RESULT=runs/NEW_FULL_ANSWER_RESULT + +"$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1 --preflight +"$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1 +"$PYTHON" -B -m crossqkv.lisa_full_answer_train --source "$SOURCE" --screen "$SCREEN" --out "$RESULT" +``` + +使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。 + +服务器约有 1.7 GiB 内存。本轮每次筛选只输入一道题,四个配置共享一次权重读取。PyTorch 进程在前两次预检中累计换页约 230 MiB,在服务器仍有约 1 GiB 可用内存时被退出。第三次预检沿用同一批冻结题,换页上限设为 384 MiB,保留服务器可用内存、进程 RSS 及运行时间检查。 diff --git a/functional/model.py b/functional/model.py index 5942217..3f1a32a 100644 --- a/functional/model.py +++ b/functional/model.py @@ -77,11 +77,13 @@ def attention(q, k, v): class StreamingLM: - def __init__(self, weights, config, seconds=7200, enforce_memory=True): + def __init__(self, weights, config, seconds=7200, enforce_memory=True, + process_swap_limit_kib=128*1024): self.tensors = load_tensors(Path(weights)) self.config = config.get('text_config', config) self.deadline = time.monotonic() + seconds self.enforce_memory = enforce_memory + self.process_swap_limit_kib = process_swap_limit_kib self.eps = self.config['rms_norm_eps'] self.norm_replacement = None self.capture_qk = False @@ -107,7 +109,8 @@ class StreamingLM: rate = (count-self.swap_observation[1])*4096/elapsed self.swap_pressure_windows = self.swap_pressure_windows+1 if rate > 4*1024**2 else 0 own_swap_kib = int(status.get('VmSwap', '0 kB').split()[0]) - if self.swap_pressure_windows >= 3 and (available < 384*1024 or own_swap_kib > 128*1024): + if self.swap_pressure_windows >= 3 and ( + available < 384*1024 or own_swap_kib > self.process_swap_limit_kib): raise MemoryError(f'Sustained host swap pressure plus constrained memory: available={available} KiB, process_swap={own_swap_kib} KiB') self.swap_observation = (now,count) if rss_kib > 512*1024 or available < 256*1024: diff --git a/results/lisa-full-answer-reproduction/code.sha256 b/results/lisa-full-answer-reproduction/code.sha256 new file mode 100644 index 0000000..57fb75b --- /dev/null +++ b/results/lisa-full-answer-reproduction/code.sha256 @@ -0,0 +1,9 @@ +a8ad25f70b2ccabfb92b82f7288e02738361d31c010e0fc83a02b5f5ecaff76b functional/model.py +987420dbdd8b885821e7e7c09c38f0b34bf3651160857941554433adec645cc0 crossqkv/lisa_generate.py +890654f75ea0ccf3cb83e221d2cc99f4873dd8a6fc016ed43fde490c9f2621ba crossqkv/lisa_full_answer.py +97bb4882ec6949c2cf2528b97f2a6f00bc0c24194f72ebdc57bc1d3c810cd185 crossqkv/lisa_full_answer_train.py +d47b4c9cc34082e9b356e745821298a43981e4cd18ed55a3f59b4b6fe7cc46e3 crossqkv/lisa_tail.py +9f0b6a53f107950661e91c16f03b49440708b3936120e2f84ef1d66f185257b6 crossqkv/lisa_train.py +96d12fdfa266ca02ac50330971ff403e04b977358f479d63c8d6276a514fe025 tests/test_lisa_full_answer.py +d1f3b3b2b92005c47f7fbc4f558407749b7059592c3b54d8b784da58ea12b3ef tests/test_lisa_tail.py +d249035103ed7f43978c0d6452bf70ec9a345777289cb92c0b6a2a181e6d4380 tests/test_lisa_train.py diff --git a/results/lisa-full-answer-reproduction/frozen.json b/results/lisa-full-answer-reproduction/frozen.json new file mode 100644 index 0000000..c437bf3 --- /dev/null +++ b/results/lisa-full-answer-reproduction/frozen.json @@ -0,0 +1,1775 @@ +{ + "protocol": { + "weights": { + "manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de", + "model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4", + "tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42" + }, + "schedules": { + "native": [], + "direct_3": [ + 15, + 19, + 23 + ], + "direct_4": [ + 11, + 15, + 19, + 23 + ], + "direct_5": [ + 7, + 11, + 15, + 19, + 23 + ] + }, + "cap": 24, + "stops": [ + "<|im_end|>", + "<|endoftext|>" + ], + "batch_prompts": 1, + "decode": "full vocabulary greedy, closed thinking prefix" + }, + "problems": { + "screen": [ + { + "id": "screen-lookup-000", + "task": "lookup", + "question": "Records in time order: maple=56, pine=95, reed=62, vine=98, kelp=86, grove=92, heath=67, cedar=23, olive=61, amber=42, larch=39, umber=82.\nWhat is the recorded number for umber?", + "answer": 82 + }, + { + "id": "screen-lookup-001", + "task": "lookup", + "question": "Records in time order: olive=25, pine=92, umber=32, heath=93, vine=47, thyme=39, kelp=43, dune=57, elm=69, iris=31, birch=23, nettle=35.\nWhat is the recorded number for vine?", + "answer": 47 + }, + { + "id": "screen-lookup-002", + "task": "lookup", + "question": "Records in time order: pine=66, fern=87, amber=74, thyme=71, dune=52, maple=51, olive=31, nettle=73, quartz=29, umber=69, iris=62, jade=26.\nWhat is the recorded number for olive?", + "answer": 31 + }, + { + "id": "screen-lookup-003", + "task": "lookup", + "question": "Records in time order: jade=58, birch=94, grove=59, umber=69, thyme=44, nettle=79, heath=78, elm=99, pine=51, yew=89, larch=47, quartz=73.\nWhat is the recorded number for pine?", + "answer": 51 + }, + { + "id": "screen-lookup-004", + "task": "lookup", + "question": "Records in time order: fern=45, larch=42, olive=92, willow=81, thyme=34, jade=49, slate=22, vine=86, umber=47, nettle=44, cedar=99, pine=66.\nWhat is the recorded number for nettle?", + "answer": 44 + }, + { + "id": "screen-lookup-005", + "task": "lookup", + "question": "Records in time order: willow=58, slate=70, kelp=22, yew=20, vine=64, iris=23, reed=98, quartz=71, dune=62, heath=81, jade=56, pine=88.\nWhat is the recorded number for kelp?", + "answer": 22 + }, + { + "id": "screen-lookup-006", + "task": "lookup", + "question": "Records in time order: maple=56, larch=90, jade=67, umber=33, birch=89, thyme=52, nettle=76, reed=59, quartz=23, grove=73, iris=72, yew=61.\nWhat is the recorded number for larch?", + "answer": 90 + }, + { + "id": "screen-lookup-007", + "task": "lookup", + "question": "Records in time order: quartz=89, pine=50, grove=64, vine=95, kelp=88, slate=79, iris=68, yew=25, larch=70, maple=78, willow=83, olive=87.\nWhat is the recorded number for olive?", + "answer": 87 + }, + { + "id": "screen-latest-000", + "task": "latest", + "question": "Records in time order: maple=88, birch=63, pine=85, birch=40, willow=95, dune=72, quartz=79, umber=46, nettle=99, vine=34, cedar=58, jade=82.\nWhat is the last recorded number for birch?", + "answer": 40 + }, + { + "id": "screen-latest-001", + "task": "latest", + "question": "Records in time order: larch=30, amber=69, fern=27, maple=37, cedar=33, reed=74, fern=53, nettle=95, dune=94, kelp=43, grove=42, umber=65.\nWhat is the last recorded number for fern?", + "answer": 53 + }, + { + "id": "screen-latest-002", + "task": "latest", + "question": "Records in time order: birch=62, jade=71, elm=78, amber=97, slate=98, jade=87, vine=50, thyme=94, pine=32, larch=96, dune=83, umber=93.\nWhat is the last recorded number for jade?", + "answer": 87 + }, + { + "id": "screen-latest-003", + "task": "latest", + "question": "Records in time order: quartz=84, quartz=78, yew=51, larch=64, maple=44, kelp=69, jade=86, willow=24, thyme=65, amber=98, pine=28, nettle=68.\nWhat is the last recorded number for quartz?", + "answer": 78 + }, + { + "id": "screen-latest-004", + "task": "latest", + "question": "Records in time order: umber=39, amber=59, maple=79, kelp=28, slate=82, grove=92, amber=44, vine=93, cedar=91, yew=64, iris=98, birch=20.\nWhat is the last recorded number for amber?", + "answer": 44 + }, + { + "id": "screen-latest-005", + "task": "latest", + "question": "Records in time order: iris=92, pine=62, vine=94, pine=37, umber=53, quartz=83, dune=39, yew=22, amber=99, heath=25, fern=71, slate=93.\nWhat is the last recorded number for pine?", + "answer": 37 + }, + { + "id": "screen-latest-006", + "task": "latest", + "question": "Records in time order: nettle=93, thyme=51, nettle=78, grove=46, cedar=98, slate=30, birch=83, larch=32, vine=74, willow=89, iris=23, elm=75.\nWhat is the last recorded number for nettle?", + "answer": 78 + }, + { + "id": "screen-latest-007", + "task": "latest", + "question": "Records in time order: kelp=32, cedar=62, pine=57, jade=93, quartz=25, vine=20, elm=73, willow=44, thyme=40, dune=24, birch=38, jade=64.\nWhat is the last recorded number for jade?", + "answer": 64 + }, + { + "id": "screen-addition-000", + "task": "addition", + "question": "What is 20 plus 63?", + "answer": 83 + }, + { + "id": "screen-addition-001", + "task": "addition", + "question": "What is 43 plus 72?", + "answer": 115 + }, + { + "id": "screen-addition-002", + "task": "addition", + "question": "What is 63 plus 86?", + "answer": 149 + }, + { + "id": "screen-addition-003", + "task": "addition", + "question": "What is 30 plus 35?", + "answer": 65 + }, + { + "id": "screen-addition-004", + "task": "addition", + "question": "What is 53 plus 55?", + "answer": 108 + }, + { + "id": "screen-addition-005", + "task": "addition", + "question": "What is 42 plus 60?", + "answer": 102 + }, + { + "id": "screen-addition-006", + "task": "addition", + "question": "What is 21 plus 79?", + "answer": 100 + }, + { + "id": "screen-addition-007", + "task": "addition", + "question": "What is 31 plus 83?", + "answer": 114 + }, + { + "id": "screen-count-000", + "task": "count", + "question": "Items: fern, fern, fern, fern, fern, fern, fern, larch, fern, larch, larch, larch, fern, larch, fern, larch, fern, fern, fern, fern.\nHow many items are exactly 'fern'?", + "answer": 14 + }, + { + "id": "screen-count-001", + "task": "count", + "question": "Items: dune, dune, fern, dune, fern, dune, dune, dune, dune, fern, fern, dune, dune, dune, dune, dune, dune.\nHow many items are exactly 'dune'?", + "answer": 13 + }, + { + "id": "screen-count-002", + "task": "count", + "question": "Items: elm, elm, elm, elm, elm, elm, elm, kelp, elm, elm, kelp, elm, elm, elm, elm, elm, kelp, elm.\nHow many items are exactly 'elm'?", + "answer": 15 + }, + { + "id": "screen-count-003", + "task": "count", + "question": "Items: dune, dune, thyme, dune, dune, dune, dune, dune, thyme, thyme, dune, dune, dune, dune, thyme, dune.\nHow many items are exactly 'dune'?", + "answer": 12 + }, + { + "id": "screen-count-004", + "task": "count", + "question": "Items: fern, dune, fern, dune, dune, dune, dune, dune, dune, fern, dune, fern, fern, fern, dune, fern, dune, dune, dune, fern, fern, dune, dune, dune.\nHow many items are exactly 'dune'?", + "answer": 15 + }, + { + "id": "screen-count-005", + "task": "count", + "question": "Items: nettle, maple, maple, maple, nettle, maple, maple, nettle, nettle, maple, maple, maple, nettle, maple, nettle, maple, nettle, maple, nettle, maple, nettle, maple.\nHow many items are exactly 'maple'?", + "answer": 13 + }, + { + "id": "screen-count-006", + "task": "count", + "question": "Items: maple, maple, maple, umber, maple, maple, maple, maple, maple, umber, maple, umber, maple, maple, maple, maple.\nHow many items are exactly 'maple'?", + "answer": 13 + }, + { + "id": "screen-count-007", + "task": "count", + "question": "Items: quartz, birch, birch, birch, quartz, birch, birch, quartz, birch, quartz, birch, quartz, quartz, birch, quartz, quartz, quartz, quartz.\nHow many items are exactly 'quartz'?", + "answer": 10 + } + ], + "fit": [ + { + "id": "fit-lookup-000", + "task": "lookup", + "question": "Records in time order: quartz=95, iris=69, dune=67, slate=61, yew=79, thyme=80, cedar=65, olive=55, amber=87, umber=28, nettle=83, maple=91.\nWhat is the recorded number for nettle?", + "answer": 83 + }, + { + "id": "fit-lookup-001", + "task": "lookup", + "question": "Records in time order: jade=52, heath=85, larch=36, olive=27, umber=98, pine=64, quartz=86, slate=55, dune=97, iris=59, birch=54, grove=87.\nWhat is the recorded number for birch?", + "answer": 54 + }, + { + "id": "fit-lookup-002", + "task": "lookup", + "question": "Records in time order: amber=52, pine=64, umber=88, vine=73, olive=61, slate=47, cedar=67, kelp=97, iris=78, elm=56, thyme=58, yew=59.\nWhat is the recorded number for vine?", + "answer": 73 + }, + { + "id": "fit-lookup-003", + "task": "lookup", + "question": "Records in time order: dune=82, kelp=25, reed=80, thyme=30, willow=96, heath=71, maple=77, umber=69, pine=52, elm=85, olive=61, quartz=56.\nWhat is the recorded number for olive?", + "answer": 61 + }, + { + "id": "fit-lookup-004", + "task": "lookup", + "question": "Records in time order: yew=65, nettle=96, iris=82, elm=92, thyme=97, cedar=44, jade=72, dune=35, quartz=89, vine=32, grove=54, willow=41.\nWhat is the recorded number for nettle?", + "answer": 96 + }, + { + "id": "fit-lookup-005", + "task": "lookup", + "question": "Records in time order: iris=82, reed=21, heath=22, pine=85, kelp=57, yew=49, thyme=66, fern=38, amber=74, umber=34, slate=50, nettle=87.\nWhat is the recorded number for slate?", + "answer": 50 + }, + { + "id": "fit-lookup-006", + "task": "lookup", + "question": "Records in time order: cedar=52, amber=86, quartz=92, dune=94, birch=24, larch=21, heath=67, olive=79, vine=42, umber=71, kelp=33, willow=98.\nWhat is the recorded number for olive?", + "answer": 79 + }, + { + "id": "fit-lookup-007", + "task": "lookup", + "question": "Records in time order: nettle=29, larch=21, thyme=84, amber=78, fern=24, heath=60, iris=26, olive=82, reed=96, grove=71, vine=30, dune=77.\nWhat is the recorded number for fern?", + "answer": 24 + }, + { + "id": "fit-lookup-008", + "task": "lookup", + "question": "Records in time order: nettle=30, birch=54, vine=58, amber=33, kelp=81, pine=39, yew=46, dune=92, quartz=34, reed=32, iris=93, jade=82.\nWhat is the recorded number for yew?", + "answer": 46 + }, + { + "id": "fit-lookup-009", + "task": "lookup", + "question": "Records in time order: larch=79, nettle=20, pine=72, iris=53, vine=56, grove=48, thyme=22, maple=40, jade=34, birch=27, quartz=63, reed=64.\nWhat is the recorded number for jade?", + "answer": 34 + }, + { + "id": "fit-lookup-010", + "task": "lookup", + "question": "Records in time order: maple=96, thyme=37, fern=24, grove=60, amber=44, umber=45, yew=35, larch=52, pine=22, nettle=28, birch=91, iris=87.\nWhat is the recorded number for umber?", + "answer": 45 + }, + { + "id": "fit-lookup-011", + "task": "lookup", + "question": "Records in time order: elm=52, heath=78, cedar=33, nettle=65, reed=41, slate=28, birch=95, olive=68, grove=38, larch=54, amber=39, thyme=80.\nWhat is the recorded number for slate?", + "answer": 28 + }, + { + "id": "fit-lookup-012", + "task": "lookup", + "question": "Records in time order: cedar=34, olive=75, willow=72, larch=85, grove=51, vine=28, heath=91, reed=89, iris=38, kelp=88, jade=25, yew=27.\nWhat is the recorded number for grove?", + "answer": 51 + }, + { + "id": "fit-lookup-013", + "task": "lookup", + "question": "Records in time order: pine=25, nettle=53, reed=85, cedar=82, vine=77, grove=64, kelp=61, birch=36, amber=30, yew=49, fern=83, slate=44.\nWhat is the recorded number for slate?", + "answer": 44 + }, + { + "id": "fit-lookup-014", + "task": "lookup", + "question": "Records in time order: willow=40, dune=71, reed=30, jade=84, quartz=86, olive=81, fern=26, grove=33, maple=63, iris=82, cedar=52, yew=42.\nWhat is the recorded number for yew?", + "answer": 42 + }, + { + "id": "fit-lookup-015", + "task": "lookup", + "question": "Records in time order: grove=55, slate=96, reed=81, birch=26, olive=57, maple=22, dune=98, pine=84, yew=94, iris=97, quartz=38, elm=51.\nWhat is the recorded number for iris?", + "answer": 97 + }, + { + "id": "fit-lookup-016", + "task": "lookup", + "question": "Records in time order: cedar=37, heath=61, kelp=83, quartz=24, iris=55, amber=20, thyme=57, dune=51, fern=79, pine=45, yew=89, reed=69.\nWhat is the recorded number for dune?", + "answer": 51 + }, + { + "id": "fit-lookup-017", + "task": "lookup", + "question": "Records in time order: kelp=33, vine=94, pine=75, elm=84, olive=43, quartz=70, birch=80, maple=66, grove=74, fern=69, cedar=57, nettle=26.\nWhat is the recorded number for birch?", + "answer": 80 + }, + { + "id": "fit-lookup-018", + "task": "lookup", + "question": "Records in time order: maple=84, thyme=91, nettle=69, heath=33, kelp=47, jade=36, umber=76, cedar=97, reed=79, fern=28, birch=25, yew=52.\nWhat is the recorded number for thyme?", + "answer": 91 + }, + { + "id": "fit-lookup-019", + "task": "lookup", + "question": "Records in time order: iris=82, grove=59, vine=96, elm=31, yew=89, pine=86, olive=76, cedar=21, maple=50, birch=77, umber=20, fern=46.\nWhat is the recorded number for vine?", + "answer": 96 + }, + { + "id": "fit-lookup-020", + "task": "lookup", + "question": "Records in time order: nettle=69, maple=61, fern=95, willow=49, cedar=45, pine=31, iris=44, thyme=73, grove=99, quartz=91, umber=75, reed=38.\nWhat is the recorded number for grove?", + "answer": 99 + }, + { + "id": "fit-lookup-021", + "task": "lookup", + "question": "Records in time order: dune=43, jade=99, reed=83, slate=64, elm=23, kelp=21, amber=40, grove=30, olive=50, heath=33, maple=92, larch=41.\nWhat is the recorded number for maple?", + "answer": 92 + }, + { + "id": "fit-lookup-022", + "task": "lookup", + "question": "Records in time order: iris=23, pine=54, cedar=97, quartz=42, willow=35, nettle=72, maple=73, slate=88, reed=39, yew=93, vine=41, amber=26.\nWhat is the recorded number for iris?", + "answer": 23 + }, + { + "id": "fit-lookup-023", + "task": "lookup", + "question": "Records in time order: pine=48, thyme=52, elm=54, cedar=42, umber=90, vine=65, grove=44, willow=47, amber=33, reed=55, olive=46, heath=82.\nWhat is the recorded number for olive?", + "answer": 46 + }, + { + "id": "fit-latest-000", + "task": "latest", + "question": "Records in time order: dune=21, iris=62, amber=55, umber=57, fern=60, yew=74, jade=50, reed=37, quartz=73, heath=89, kelp=98, reed=85.\nWhat is the last recorded number for reed?", + "answer": 85 + }, + { + "id": "fit-latest-001", + "task": "latest", + "question": "Records in time order: fern=98, fern=81, jade=92, yew=42, iris=23, heath=48, amber=79, dune=61, willow=85, nettle=33, birch=28, larch=46.\nWhat is the last recorded number for fern?", + "answer": 81 + }, + { + "id": "fit-latest-002", + "task": "latest", + "question": "Records in time order: maple=45, cedar=37, pine=78, elm=94, fern=21, olive=89, quartz=90, slate=48, kelp=30, olive=57, amber=35, iris=97.\nWhat is the last recorded number for olive?", + "answer": 57 + }, + { + "id": "fit-latest-003", + "task": "latest", + "question": "Records in time order: larch=79, iris=34, cedar=78, elm=27, quartz=42, thyme=62, heath=87, pine=95, pine=91, slate=20, umber=82, maple=50.\nWhat is the last recorded number for pine?", + "answer": 91 + }, + { + "id": "fit-latest-004", + "task": "latest", + "question": "Records in time order: yew=77, larch=54, grove=99, quartz=39, jade=92, heath=30, heath=82, reed=24, cedar=85, nettle=49, fern=69, iris=95.\nWhat is the last recorded number for heath?", + "answer": 82 + }, + { + "id": "fit-latest-005", + "task": "latest", + "question": "Records in time order: dune=95, dune=46, reed=21, umber=49, heath=55, jade=69, thyme=75, cedar=32, willow=40, yew=53, elm=33, quartz=26.\nWhat is the last recorded number for dune?", + "answer": 46 + }, + { + "id": "fit-latest-006", + "task": "latest", + "question": "Records in time order: pine=60, dune=85, fern=71, cedar=43, larch=80, jade=26, reed=76, kelp=30, fern=72, willow=95, olive=78, grove=39.\nWhat is the last recorded number for fern?", + "answer": 72 + }, + { + "id": "fit-latest-007", + "task": "latest", + "question": "Records in time order: birch=98, grove=53, willow=28, dune=71, amber=70, reed=72, yew=86, amber=79, vine=47, fern=20, heath=66, cedar=99.\nWhat is the last recorded number for amber?", + "answer": 79 + }, + { + "id": "fit-latest-008", + "task": "latest", + "question": "Records in time order: larch=32, vine=21, elm=55, amber=48, birch=98, pine=76, maple=65, dune=93, cedar=70, iris=68, heath=44, dune=99.\nWhat is the last recorded number for dune?", + "answer": 99 + }, + { + "id": "fit-latest-009", + "task": "latest", + "question": "Records in time order: pine=53, birch=67, vine=29, yew=31, birch=61, elm=45, grove=76, quartz=62, slate=41, amber=27, cedar=49, kelp=37.\nWhat is the last recorded number for birch?", + "answer": 61 + }, + { + "id": "fit-latest-010", + "task": "latest", + "question": "Records in time order: larch=89, larch=87, heath=53, iris=37, slate=36, birch=39, nettle=74, elm=61, willow=65, umber=31, maple=75, amber=85.\nWhat is the last recorded number for larch?", + "answer": 87 + }, + { + "id": "fit-latest-011", + "task": "latest", + "question": "Records in time order: elm=43, pine=48, amber=90, cedar=23, pine=30, fern=38, vine=81, thyme=75, kelp=22, grove=34, quartz=73, dune=95.\nWhat is the last recorded number for pine?", + "answer": 30 + }, + { + "id": "fit-latest-012", + "task": "latest", + "question": "Records in time order: fern=55, fern=51, yew=98, maple=72, elm=66, nettle=26, heath=25, pine=81, reed=84, birch=74, jade=88, vine=56.\nWhat is the last recorded number for fern?", + "answer": 51 + }, + { + "id": "fit-latest-013", + "task": "latest", + "question": "Records in time order: larch=88, quartz=91, reed=89, thyme=61, kelp=73, grove=27, fern=39, reed=23, heath=38, pine=72, nettle=76, dune=80.\nWhat is the last recorded number for reed?", + "answer": 23 + }, + { + "id": "fit-latest-014", + "task": "latest", + "question": "Records in time order: quartz=42, iris=53, iris=25, maple=43, elm=65, heath=82, jade=62, larch=92, olive=29, umber=49, dune=81, reed=89.\nWhat is the last recorded number for iris?", + "answer": 25 + }, + { + "id": "fit-latest-015", + "task": "latest", + "question": "Records in time order: thyme=73, willow=84, iris=48, yew=38, jade=93, nettle=44, maple=24, dune=54, maple=30, cedar=59, vine=81, reed=37.\nWhat is the last recorded number for maple?", + "answer": 30 + }, + { + "id": "fit-latest-016", + "task": "latest", + "question": "Records in time order: umber=67, maple=75, slate=60, iris=51, reed=88, cedar=21, vine=38, grove=99, olive=93, reed=91, elm=36, amber=40.\nWhat is the last recorded number for reed?", + "answer": 91 + }, + { + "id": "fit-latest-017", + "task": "latest", + "question": "Records in time order: pine=63, larch=62, vine=69, amber=67, iris=83, quartz=64, jade=81, umber=93, dune=66, dune=25, slate=39, thyme=23.\nWhat is the last recorded number for dune?", + "answer": 25 + }, + { + "id": "fit-latest-018", + "task": "latest", + "question": "Records in time order: amber=80, elm=44, nettle=98, fern=76, slate=70, vine=94, thyme=49, birch=68, yew=61, cedar=41, dune=24, dune=38.\nWhat is the last recorded number for dune?", + "answer": 38 + }, + { + "id": "fit-latest-019", + "task": "latest", + "question": "Records in time order: vine=52, thyme=80, vine=78, pine=22, larch=66, willow=77, maple=42, iris=25, olive=75, dune=62, umber=64, quartz=90.\nWhat is the last recorded number for vine?", + "answer": 78 + }, + { + "id": "fit-latest-020", + "task": "latest", + "question": "Records in time order: dune=48, reed=31, jade=43, thyme=90, larch=52, vine=20, yew=99, elm=75, grove=77, quartz=65, iris=28, yew=74.\nWhat is the last recorded number for yew?", + "answer": 74 + }, + { + "id": "fit-latest-021", + "task": "latest", + "question": "Records in time order: slate=76, reed=40, nettle=38, elm=58, kelp=62, larch=23, umber=27, pine=68, fern=97, iris=98, cedar=75, elm=54.\nWhat is the last recorded number for elm?", + "answer": 54 + }, + { + "id": "fit-latest-022", + "task": "latest", + "question": "Records in time order: pine=81, olive=91, jade=43, pine=84, iris=24, fern=22, elm=57, heath=58, cedar=80, dune=33, willow=98, amber=31.\nWhat is the last recorded number for pine?", + "answer": 84 + }, + { + "id": "fit-latest-023", + "task": "latest", + "question": "Records in time order: grove=25, iris=39, amber=46, umber=32, olive=64, jade=43, birch=61, heath=76, pine=54, elm=62, jade=36, thyme=93.\nWhat is the last recorded number for jade?", + "answer": 36 + }, + { + "id": "fit-addition-000", + "task": "addition", + "question": "What is 44 plus 51?", + "answer": 95 + }, + { + "id": "fit-addition-001", + "task": "addition", + "question": "What is 22 plus 55?", + "answer": 77 + }, + { + "id": "fit-addition-002", + "task": "addition", + "question": "What is 68 plus 87?", + "answer": 155 + }, + { + "id": "fit-addition-003", + "task": "addition", + "question": "What is 43 plus 88?", + "answer": 131 + }, + { + "id": "fit-addition-004", + "task": "addition", + "question": "What is 49 plus 63?", + "answer": 112 + }, + { + "id": "fit-addition-005", + "task": "addition", + "question": "What is 49 plus 83?", + "answer": 132 + }, + { + "id": "fit-addition-006", + "task": "addition", + "question": "What is 21 plus 88?", + "answer": 109 + }, + { + "id": "fit-addition-007", + "task": "addition", + "question": "What is 60 plus 61?", + "answer": 121 + }, + { + "id": "fit-addition-008", + "task": "addition", + "question": "What is 22 plus 64?", + "answer": 86 + }, + { + "id": "fit-addition-009", + "task": "addition", + "question": "What is 41 plus 87?", + "answer": 128 + }, + { + "id": "fit-addition-010", + "task": "addition", + "question": "What is 34 plus 42?", + "answer": 76 + }, + { + "id": "fit-addition-011", + "task": "addition", + "question": "What is 28 plus 72?", + "answer": 100 + }, + { + "id": "fit-addition-012", + "task": "addition", + "question": "What is 65 plus 71?", + "answer": 136 + }, + { + "id": "fit-addition-013", + "task": "addition", + "question": "What is 43 plus 56?", + "answer": 99 + }, + { + "id": "fit-addition-014", + "task": "addition", + "question": "What is 69 plus 71?", + "answer": 140 + }, + { + "id": "fit-addition-015", + "task": "addition", + "question": "What is 52 plus 71?", + "answer": 123 + }, + { + "id": "fit-addition-016", + "task": "addition", + "question": "What is 26 plus 62?", + "answer": 88 + }, + { + "id": "fit-addition-017", + "task": "addition", + "question": "What is 77 plus 84?", + "answer": 161 + }, + { + "id": "fit-addition-018", + "task": "addition", + "question": "What is 73 plus 73?", + "answer": 146 + }, + { + "id": "fit-addition-019", + "task": "addition", + "question": "What is 60 plus 76?", + "answer": 136 + }, + { + "id": "fit-addition-020", + "task": "addition", + "question": "What is 69 plus 85?", + "answer": 154 + }, + { + "id": "fit-addition-021", + "task": "addition", + "question": "What is 20 plus 44?", + "answer": 64 + }, + { + "id": "fit-addition-022", + "task": "addition", + "question": "What is 43 plus 63?", + "answer": 106 + }, + { + "id": "fit-addition-023", + "task": "addition", + "question": "What is 40 plus 79?", + "answer": 119 + }, + { + "id": "fit-count-000", + "task": "count", + "question": "Items: cedar, willow, cedar, cedar, cedar, cedar, cedar, cedar, cedar, cedar, cedar, willow, willow, willow, cedar, cedar, cedar, cedar.\nHow many items are exactly 'cedar'?", + "answer": 14 + }, + { + "id": "fit-count-001", + "task": "count", + "question": "Items: yew, jade, yew, yew, yew, yew, yew, jade, yew, jade, yew, yew, jade, jade, yew, yew, yew, yew.\nHow many items are exactly 'yew'?", + "answer": 13 + }, + { + "id": "fit-count-002", + "task": "count", + "question": "Items: thyme, thyme, dune, dune, dune, dune, thyme, dune, dune, thyme, dune, dune, dune, dune, thyme.\nHow many items are exactly 'dune'?", + "answer": 10 + }, + { + "id": "fit-count-003", + "task": "count", + "question": "Items: pine, pine, pine, elm, elm, pine, elm, pine, elm, pine, pine, elm, pine, pine, pine, pine, elm, elm, elm, pine, elm, pine.\nHow many items are exactly 'pine'?", + "answer": 13 + }, + { + "id": "fit-count-004", + "task": "count", + "question": "Items: vine, vine, vine, vine, quartz, vine, vine, quartz, quartz, vine, quartz, vine, quartz, vine, vine, quartz, vine, vine, quartz.\nHow many items are exactly 'vine'?", + "answer": 12 + }, + { + "id": "fit-count-005", + "task": "count", + "question": "Items: dune, dune, iris, iris, iris, dune, dune, dune, dune, dune, dune, dune, iris, dune, dune, iris, dune, dune, dune, iris.\nHow many items are exactly 'dune'?", + "answer": 14 + }, + { + "id": "fit-count-006", + "task": "count", + "question": "Items: elm, nettle, nettle, nettle, elm, nettle, elm, nettle, elm, nettle, elm, nettle, elm, nettle, nettle, nettle, elm, elm, elm.\nHow many items are exactly 'nettle'?", + "answer": 10 + }, + { + "id": "fit-count-007", + "task": "count", + "question": "Items: umber, umber, umber, amber, umber, amber, umber, umber, umber, amber, umber, umber, umber, amber, umber, umber, umber, amber.\nHow many items are exactly 'umber'?", + "answer": 13 + }, + { + "id": "fit-count-008", + "task": "count", + "question": "Items: dune, dune, dune, dune, slate, slate, slate, dune, dune, dune, slate, dune, dune, dune, dune.\nHow many items are exactly 'dune'?", + "answer": 11 + }, + { + "id": "fit-count-009", + "task": "count", + "question": "Items: pine, jade, jade, jade, pine, pine, jade, pine, pine, pine, pine, pine, jade, jade, jade, pine, pine, jade, pine, pine, pine, jade, pine.\nHow many items are exactly 'pine'?", + "answer": 14 + }, + { + "id": "fit-count-010", + "task": "count", + "question": "Items: grove, grove, grove, grove, cedar, grove, grove, cedar, grove, grove, grove, grove, cedar, grove, grove.\nHow many items are exactly 'grove'?", + "answer": 12 + }, + { + "id": "fit-count-011", + "task": "count", + "question": "Items: cedar, nettle, cedar, cedar, nettle, cedar, cedar, nettle, nettle, nettle, cedar, cedar, nettle, nettle, cedar, cedar, nettle, cedar, cedar, nettle.\nHow many items are exactly 'cedar'?", + "answer": 11 + }, + { + "id": "fit-count-012", + "task": "count", + "question": "Items: grove, grove, grove, grove, grove, amber, amber, grove, grove, grove, amber, grove, amber, amber, grove, amber, amber.\nHow many items are exactly 'grove'?", + "answer": 10 + }, + { + "id": "fit-count-013", + "task": "count", + "question": "Items: thyme, thyme, thyme, elm, thyme, elm, elm, thyme, elm, thyme, elm, elm, thyme, thyme, thyme, thyme, thyme, thyme, thyme, thyme, elm.\nHow many items are exactly 'thyme'?", + "answer": 14 + }, + { + "id": "fit-count-014", + "task": "count", + "question": "Items: thyme, thyme, grove, thyme, grove, grove, thyme, thyme, thyme, thyme, thyme, thyme, thyme, grove, grove, thyme, grove, thyme, thyme, grove, thyme, thyme, grove, grove.\nHow many items are exactly 'thyme'?", + "answer": 15 + }, + { + "id": "fit-count-015", + "task": "count", + "question": "Items: amber, quartz, amber, quartz, amber, amber, amber, quartz, amber, amber, amber, amber, quartz, amber, amber, quartz, quartz.\nHow many items are exactly 'amber'?", + "answer": 11 + }, + { + "id": "fit-count-016", + "task": "count", + "question": "Items: vine, umber, umber, vine, vine, umber, vine, vine, vine, vine, umber, vine, umber, umber, vine, umber, vine, vine, vine.\nHow many items are exactly 'vine'?", + "answer": 12 + }, + { + "id": "fit-count-017", + "task": "count", + "question": "Items: fern, fern, fern, fern, fern, fern, fern, fern, elm, elm, fern, elm, fern, fern, elm, fern, fern, fern.\nHow many items are exactly 'fern'?", + "answer": 14 + }, + { + "id": "fit-count-018", + "task": "count", + "question": "Items: fern, fern, reed, reed, reed, fern, reed, reed, reed, fern, reed, fern, reed, fern, reed, reed, fern, fern, reed, fern.\nHow many items are exactly 'reed'?", + "answer": 11 + }, + { + "id": "fit-count-019", + "task": "count", + "question": "Items: grove, grove, grove, grove, kelp, grove, grove, grove, grove, kelp, kelp, grove, grove, kelp, kelp, grove, grove, grove, kelp, kelp, kelp, kelp, grove.\nHow many items are exactly 'grove'?", + "answer": 14 + }, + { + "id": "fit-count-020", + "task": "count", + "question": "Items: kelp, grove, kelp, kelp, kelp, grove, grove, grove, kelp, kelp, grove, kelp, grove, kelp, kelp, kelp, kelp, kelp, kelp.\nHow many items are exactly 'kelp'?", + "answer": 13 + }, + { + "id": "fit-count-021", + "task": "count", + "question": "Items: olive, olive, olive, larch, larch, olive, larch, olive, olive, olive, olive, larch, olive, larch, olive, olive, larch, olive.\nHow many items are exactly 'olive'?", + "answer": 12 + }, + { + "id": "fit-count-022", + "task": "count", + "question": "Items: vine, vine, vine, vine, pine, pine, vine, pine, vine, pine, vine, vine, pine, vine, pine, pine, vine, vine.\nHow many items are exactly 'vine'?", + "answer": 11 + }, + { + "id": "fit-count-023", + "task": "count", + "question": "Items: larch, pine, larch, larch, pine, larch, pine, pine, pine, pine, larch, pine, larch, pine, pine, pine, pine.\nHow many items are exactly 'pine'?", + "answer": 11 + } + ], + "validation": [ + { + "id": "validation-lookup-000", + "task": "lookup", + "question": "Records in time order: iris=94, nettle=28, quartz=35, slate=65, heath=73, yew=36, thyme=23, cedar=89, umber=76, birch=97, larch=45, vine=59.\nWhat is the recorded number for nettle?", + "answer": 28 + }, + { + "id": "validation-lookup-001", + "task": "lookup", + "question": "Records in time order: dune=29, larch=77, elm=85, amber=83, slate=66, maple=68, umber=90, olive=58, iris=96, heath=55, vine=92, birch=81.\nWhat is the recorded number for vine?", + "answer": 92 + }, + { + "id": "validation-lookup-002", + "task": "lookup", + "question": "Records in time order: fern=42, larch=29, cedar=44, kelp=27, quartz=45, olive=58, maple=84, birch=91, vine=24, dune=41, yew=71, grove=98.\nWhat is the recorded number for yew?", + "answer": 71 + }, + { + "id": "validation-lookup-003", + "task": "lookup", + "question": "Records in time order: iris=89, nettle=68, willow=36, umber=54, yew=38, thyme=33, larch=53, birch=65, olive=34, kelp=49, cedar=84, grove=71.\nWhat is the recorded number for iris?", + "answer": 89 + }, + { + "id": "validation-lookup-004", + "task": "lookup", + "question": "Records in time order: fern=28, larch=99, nettle=83, pine=59, amber=98, dune=69, yew=39, grove=71, birch=43, maple=86, kelp=88, elm=54.\nWhat is the recorded number for amber?", + "answer": 98 + }, + { + "id": "validation-lookup-005", + "task": "lookup", + "question": "Records in time order: amber=71, willow=69, kelp=81, yew=59, olive=65, iris=33, thyme=35, reed=84, dune=72, grove=26, larch=43, slate=97.\nWhat is the recorded number for grove?", + "answer": 26 + }, + { + "id": "validation-lookup-006", + "task": "lookup", + "question": "Records in time order: yew=48, amber=47, kelp=91, olive=88, cedar=68, quartz=34, larch=38, fern=73, slate=96, maple=35, grove=50, reed=78.\nWhat is the recorded number for larch?", + "answer": 38 + }, + { + "id": "validation-lookup-007", + "task": "lookup", + "question": "Records in time order: yew=39, reed=64, vine=55, maple=32, iris=53, elm=72, amber=88, fern=35, kelp=59, birch=65, nettle=40, larch=24.\nWhat is the recorded number for maple?", + "answer": 32 + }, + { + "id": "validation-latest-000", + "task": "latest", + "question": "Records in time order: iris=55, maple=94, reed=35, elm=69, slate=34, larch=89, umber=51, quartz=91, umber=25, jade=71, fern=79, dune=97.\nWhat is the last recorded number for umber?", + "answer": 25 + }, + { + "id": "validation-latest-001", + "task": "latest", + "question": "Records in time order: larch=30, dune=35, vine=81, thyme=91, maple=63, iris=99, cedar=64, birch=84, pine=82, vine=72, fern=60, umber=88.\nWhat is the last recorded number for vine?", + "answer": 72 + }, + { + "id": "validation-latest-002", + "task": "latest", + "question": "Records in time order: iris=78, pine=84, cedar=94, iris=72, willow=66, heath=29, elm=96, thyme=92, umber=26, kelp=97, vine=51, jade=83.\nWhat is the last recorded number for iris?", + "answer": 72 + }, + { + "id": "validation-latest-003", + "task": "latest", + "question": "Records in time order: cedar=90, jade=99, reed=84, thyme=67, heath=80, reed=97, yew=87, umber=52, amber=94, quartz=36, pine=65, birch=25.\nWhat is the last recorded number for reed?", + "answer": 97 + }, + { + "id": "validation-latest-004", + "task": "latest", + "question": "Records in time order: slate=58, maple=71, slate=28, larch=82, cedar=35, quartz=67, kelp=20, olive=98, amber=36, birch=80, reed=88, grove=46.\nWhat is the last recorded number for slate?", + "answer": 28 + }, + { + "id": "validation-latest-005", + "task": "latest", + "question": "Records in time order: thyme=89, iris=76, heath=27, nettle=69, amber=90, pine=39, vine=85, yew=54, birch=32, larch=29, nettle=59, jade=64.\nWhat is the last recorded number for nettle?", + "answer": 59 + }, + { + "id": "validation-latest-006", + "task": "latest", + "question": "Records in time order: fern=76, fern=82, maple=86, thyme=68, birch=37, iris=75, cedar=29, willow=38, elm=60, quartz=34, pine=52, olive=32.\nWhat is the last recorded number for fern?", + "answer": 82 + }, + { + "id": "validation-latest-007", + "task": "latest", + "question": "Records in time order: amber=62, iris=60, thyme=47, thyme=51, grove=45, willow=98, fern=61, jade=83, olive=55, umber=64, slate=24, quartz=93.\nWhat is the last recorded number for thyme?", + "answer": 51 + }, + { + "id": "validation-addition-000", + "task": "addition", + "question": "What is 30 plus 77?", + "answer": 107 + }, + { + "id": "validation-addition-001", + "task": "addition", + "question": "What is 36 plus 77?", + "answer": 113 + }, + { + "id": "validation-addition-002", + "task": "addition", + "question": "What is 44 plus 67?", + "answer": 111 + }, + { + "id": "validation-addition-003", + "task": "addition", + "question": "What is 31 plus 67?", + "answer": 98 + }, + { + "id": "validation-addition-004", + "task": "addition", + "question": "What is 23 plus 76?", + "answer": 99 + }, + { + "id": "validation-addition-005", + "task": "addition", + "question": "What is 24 plus 44?", + "answer": 68 + }, + { + "id": "validation-addition-006", + "task": "addition", + "question": "What is 60 plus 63?", + "answer": 123 + }, + { + "id": "validation-addition-007", + "task": "addition", + "question": "What is 53 plus 82?", + "answer": 135 + }, + { + "id": "validation-count-000", + "task": "count", + "question": "Items: reed, olive, olive, reed, reed, reed, reed, olive, reed, olive, reed, olive, reed, reed, reed, reed, olive, reed, olive, olive, reed.\nHow many items are exactly 'reed'?", + "answer": 13 + }, + { + "id": "validation-count-001", + "task": "count", + "question": "Items: olive, kelp, olive, olive, olive, olive, kelp, olive, olive, olive, kelp, olive, olive, olive, olive, olive.\nHow many items are exactly 'olive'?", + "answer": 13 + }, + { + "id": "validation-count-002", + "task": "count", + "question": "Items: fern, kelp, fern, kelp, fern, kelp, kelp, fern, kelp, fern, kelp, fern, fern, kelp, fern, fern, fern.\nHow many items are exactly 'fern'?", + "answer": 10 + }, + { + "id": "validation-count-003", + "task": "count", + "question": "Items: olive, olive, cedar, olive, cedar, olive, cedar, cedar, olive, olive, olive, olive, olive, olive, cedar, cedar, olive, olive, olive.\nHow many items are exactly 'olive'?", + "answer": 13 + }, + { + "id": "validation-count-004", + "task": "count", + "question": "Items: dune, dune, dune, elm, dune, dune, elm, dune, dune, dune, dune, dune, elm, elm, elm, dune, dune, elm, dune, elm, elm, dune, elm.\nHow many items are exactly 'dune'?", + "answer": 14 + }, + { + "id": "validation-count-005", + "task": "count", + "question": "Items: maple, maple, cedar, cedar, cedar, maple, maple, cedar, maple, maple, maple, cedar, cedar, cedar, cedar, maple, cedar, maple, maple, maple.\nHow many items are exactly 'maple'?", + "answer": 11 + }, + { + "id": "validation-count-006", + "task": "count", + "question": "Items: iris, iris, iris, iris, grove, iris, iris, grove, iris, iris, iris, iris, grove, iris, iris, grove, grove, iris, grove, grove, grove, iris, grove.\nHow many items are exactly 'iris'?", + "answer": 14 + }, + { + "id": "validation-count-007", + "task": "count", + "question": "Items: fern, jade, jade, jade, fern, fern, fern, fern, fern, fern, fern, fern, jade, fern, fern, fern, fern, fern, jade, jade.\nHow many items are exactly 'fern'?", + "answer": 14 + } + ], + "test": [ + { + "id": "test-lookup-000", + "task": "lookup", + "question": "Records in time order: pine=72, yew=79, maple=61, jade=50, cedar=88, larch=25, elm=96, dune=22, fern=26, heath=92, olive=37, willow=91.\nWhat is the recorded number for yew?", + "answer": 79 + }, + { + "id": "test-lookup-001", + "task": "lookup", + "question": "Records in time order: jade=69, quartz=42, dune=70, heath=68, elm=87, cedar=50, iris=97, amber=94, larch=65, yew=63, kelp=27, reed=99.\nWhat is the recorded number for dune?", + "answer": 70 + }, + { + "id": "test-lookup-002", + "task": "lookup", + "question": "Records in time order: larch=34, heath=75, thyme=23, kelp=26, fern=88, elm=69, quartz=92, dune=48, willow=55, iris=85, yew=84, cedar=71.\nWhat is the recorded number for quartz?", + "answer": 92 + }, + { + "id": "test-lookup-003", + "task": "lookup", + "question": "Records in time order: iris=77, reed=29, kelp=70, slate=68, pine=76, fern=20, grove=49, nettle=94, amber=73, cedar=62, yew=59, maple=21.\nWhat is the recorded number for slate?", + "answer": 68 + }, + { + "id": "test-lookup-004", + "task": "lookup", + "question": "Records in time order: cedar=80, amber=90, grove=29, slate=46, birch=85, dune=43, yew=75, fern=21, iris=69, vine=58, maple=65, willow=67.\nWhat is the recorded number for vine?", + "answer": 58 + }, + { + "id": "test-lookup-005", + "task": "lookup", + "question": "Records in time order: dune=64, birch=75, cedar=74, vine=48, larch=41, fern=85, quartz=38, slate=83, iris=31, jade=96, maple=65, yew=84.\nWhat is the recorded number for dune?", + "answer": 64 + }, + { + "id": "test-lookup-006", + "task": "lookup", + "question": "Records in time order: amber=69, yew=24, reed=35, thyme=26, willow=67, umber=36, vine=97, dune=50, birch=85, nettle=28, iris=73, maple=64.\nWhat is the recorded number for dune?", + "answer": 50 + }, + { + "id": "test-lookup-007", + "task": "lookup", + "question": "Records in time order: iris=38, fern=25, heath=60, vine=90, grove=79, cedar=21, slate=66, nettle=24, thyme=86, pine=91, quartz=65, dune=70.\nWhat is the recorded number for iris?", + "answer": 38 + }, + { + "id": "test-lookup-008", + "task": "lookup", + "question": "Records in time order: olive=65, yew=70, vine=32, grove=83, amber=76, larch=84, thyme=97, quartz=29, jade=89, maple=27, dune=31, cedar=45.\nWhat is the recorded number for dune?", + "answer": 31 + }, + { + "id": "test-lookup-009", + "task": "lookup", + "question": "Records in time order: birch=68, olive=60, heath=73, amber=95, grove=64, jade=90, dune=66, iris=33, umber=26, nettle=41, thyme=24, quartz=91.\nWhat is the recorded number for thyme?", + "answer": 24 + }, + { + "id": "test-lookup-010", + "task": "lookup", + "question": "Records in time order: elm=37, maple=46, cedar=40, pine=92, fern=53, willow=26, yew=97, amber=94, olive=84, heath=85, larch=56, thyme=69.\nWhat is the recorded number for thyme?", + "answer": 69 + }, + { + "id": "test-lookup-011", + "task": "lookup", + "question": "Records in time order: fern=34, nettle=92, amber=45, iris=52, olive=73, dune=37, willow=54, thyme=39, slate=20, larch=76, umber=70, elm=36.\nWhat is the recorded number for nettle?", + "answer": 92 + }, + { + "id": "test-lookup-012", + "task": "lookup", + "question": "Records in time order: dune=64, yew=92, fern=98, willow=42, elm=30, kelp=90, maple=21, pine=65, vine=40, grove=67, reed=25, jade=69.\nWhat is the recorded number for fern?", + "answer": 98 + }, + { + "id": "test-lookup-013", + "task": "lookup", + "question": "Records in time order: elm=44, pine=92, vine=62, larch=68, slate=45, quartz=93, yew=99, kelp=88, olive=58, jade=38, amber=40, thyme=27.\nWhat is the recorded number for thyme?", + "answer": 27 + }, + { + "id": "test-lookup-014", + "task": "lookup", + "question": "Records in time order: grove=68, dune=96, willow=28, thyme=72, jade=75, elm=82, umber=87, reed=76, fern=92, quartz=71, pine=55, birch=43.\nWhat is the recorded number for quartz?", + "answer": 71 + }, + { + "id": "test-lookup-015", + "task": "lookup", + "question": "Records in time order: amber=35, dune=30, iris=33, willow=67, vine=88, olive=60, birch=32, slate=77, cedar=49, maple=59, heath=21, yew=24.\nWhat is the recorded number for vine?", + "answer": 88 + }, + { + "id": "test-lookup-016", + "task": "lookup", + "question": "Records in time order: maple=81, dune=41, amber=88, fern=77, umber=84, olive=22, pine=89, vine=42, birch=66, willow=98, grove=40, jade=72.\nWhat is the recorded number for maple?", + "answer": 81 + }, + { + "id": "test-lookup-017", + "task": "lookup", + "question": "Records in time order: quartz=72, larch=50, olive=20, umber=22, amber=71, slate=55, thyme=65, vine=95, elm=93, fern=99, kelp=67, maple=84.\nWhat is the recorded number for elm?", + "answer": 93 + }, + { + "id": "test-lookup-018", + "task": "lookup", + "question": "Records in time order: elm=55, reed=73, birch=65, amber=62, dune=90, jade=22, pine=52, umber=40, larch=30, thyme=71, nettle=85, heath=27.\nWhat is the recorded number for larch?", + "answer": 30 + }, + { + "id": "test-lookup-019", + "task": "lookup", + "question": "Records in time order: yew=46, elm=58, nettle=30, iris=44, grove=59, umber=72, jade=51, larch=27, pine=94, thyme=89, heath=78, vine=49.\nWhat is the recorded number for iris?", + "answer": 44 + }, + { + "id": "test-lookup-020", + "task": "lookup", + "question": "Records in time order: amber=50, dune=39, kelp=44, vine=83, grove=65, slate=97, umber=24, elm=78, willow=81, yew=94, reed=41, fern=70.\nWhat is the recorded number for yew?", + "answer": 94 + }, + { + "id": "test-lookup-021", + "task": "lookup", + "question": "Records in time order: birch=72, nettle=80, umber=43, grove=32, willow=85, jade=49, yew=83, dune=44, kelp=23, slate=20, fern=87, quartz=75.\nWhat is the recorded number for dune?", + "answer": 44 + }, + { + "id": "test-lookup-022", + "task": "lookup", + "question": "Records in time order: maple=30, larch=54, fern=94, thyme=85, olive=65, dune=26, willow=20, reed=46, yew=99, cedar=23, vine=87, birch=62.\nWhat is the recorded number for maple?", + "answer": 30 + }, + { + "id": "test-lookup-023", + "task": "lookup", + "question": "Records in time order: cedar=34, dune=28, heath=44, jade=62, thyme=27, larch=37, iris=31, vine=40, slate=66, yew=48, elm=70, maple=39.\nWhat is the recorded number for iris?", + "answer": 31 + }, + { + "id": "test-lookup-024", + "task": "lookup", + "question": "Records in time order: maple=43, vine=69, yew=65, fern=29, kelp=75, elm=96, iris=84, willow=97, thyme=88, larch=31, heath=98, birch=95.\nWhat is the recorded number for fern?", + "answer": 29 + }, + { + "id": "test-lookup-025", + "task": "lookup", + "question": "Records in time order: heath=44, vine=84, umber=48, iris=26, pine=97, amber=58, slate=67, cedar=25, elm=35, dune=90, olive=28, reed=57.\nWhat is the recorded number for vine?", + "answer": 84 + }, + { + "id": "test-lookup-026", + "task": "lookup", + "question": "Records in time order: kelp=99, reed=94, nettle=29, birch=98, olive=38, elm=72, thyme=54, pine=45, jade=53, umber=73, cedar=79, vine=42.\nWhat is the recorded number for nettle?", + "answer": 29 + }, + { + "id": "test-lookup-027", + "task": "lookup", + "question": "Records in time order: slate=60, kelp=22, pine=77, thyme=40, reed=91, dune=41, quartz=31, nettle=21, cedar=43, vine=48, fern=89, olive=24.\nWhat is the recorded number for fern?", + "answer": 89 + }, + { + "id": "test-lookup-028", + "task": "lookup", + "question": "Records in time order: maple=92, slate=54, larch=94, willow=60, elm=57, amber=26, birch=76, thyme=96, cedar=79, reed=85, jade=63, dune=47.\nWhat is the recorded number for jade?", + "answer": 63 + }, + { + "id": "test-lookup-029", + "task": "lookup", + "question": "Records in time order: amber=62, willow=24, maple=86, grove=40, birch=36, quartz=96, reed=88, kelp=63, elm=22, thyme=65, larch=73, olive=44.\nWhat is the recorded number for grove?", + "answer": 40 + }, + { + "id": "test-lookup-030", + "task": "lookup", + "question": "Records in time order: willow=22, fern=66, quartz=69, slate=92, iris=79, maple=67, olive=88, cedar=23, jade=68, elm=64, reed=39, amber=89.\nWhat is the recorded number for reed?", + "answer": 39 + }, + { + "id": "test-lookup-031", + "task": "lookup", + "question": "Records in time order: jade=97, slate=98, elm=55, pine=61, cedar=72, iris=50, heath=45, thyme=80, quartz=58, umber=49, amber=79, birch=94.\nWhat is the recorded number for pine?", + "answer": 61 + }, + { + "id": "test-latest-000", + "task": "latest", + "question": "Records in time order: vine=94, grove=95, heath=24, grove=67, thyme=59, reed=55, cedar=35, pine=53, olive=64, nettle=40, kelp=38, slate=42.\nWhat is the last recorded number for grove?", + "answer": 67 + }, + { + "id": "test-latest-001", + "task": "latest", + "question": "Records in time order: kelp=42, larch=86, slate=20, dune=32, olive=30, elm=52, grove=34, reed=27, quartz=79, heath=85, reed=82, nettle=60.\nWhat is the last recorded number for reed?", + "answer": 82 + }, + { + "id": "test-latest-002", + "task": "latest", + "question": "Records in time order: iris=68, maple=47, umber=93, kelp=56, olive=37, thyme=26, nettle=86, willow=98, larch=57, willow=42, birch=63, cedar=82.\nWhat is the last recorded number for willow?", + "answer": 42 + }, + { + "id": "test-latest-003", + "task": "latest", + "question": "Records in time order: dune=80, kelp=61, birch=85, quartz=82, quartz=35, slate=38, vine=45, olive=51, cedar=92, fern=67, grove=49, thyme=22.\nWhat is the last recorded number for quartz?", + "answer": 35 + }, + { + "id": "test-latest-004", + "task": "latest", + "question": "Records in time order: jade=92, jade=56, iris=69, olive=88, grove=91, willow=34, kelp=68, pine=89, nettle=86, quartz=99, yew=23, slate=80.\nWhat is the last recorded number for jade?", + "answer": 56 + }, + { + "id": "test-latest-005", + "task": "latest", + "question": "Records in time order: nettle=49, fern=32, vine=71, olive=40, vine=92, birch=96, willow=31, reed=42, umber=83, larch=44, yew=98, maple=56.\nWhat is the last recorded number for vine?", + "answer": 92 + }, + { + "id": "test-latest-006", + "task": "latest", + "question": "Records in time order: elm=72, cedar=59, pine=64, yew=70, nettle=38, iris=71, birch=49, willow=58, slate=78, grove=99, reed=94, cedar=42.\nWhat is the last recorded number for cedar?", + "answer": 42 + }, + { + "id": "test-latest-007", + "task": "latest", + "question": "Records in time order: amber=55, yew=56, vine=81, pine=33, slate=47, grove=70, thyme=57, umber=74, pine=23, fern=50, nettle=42, birch=62.\nWhat is the last recorded number for pine?", + "answer": 23 + }, + { + "id": "test-latest-008", + "task": "latest", + "question": "Records in time order: iris=34, elm=22, vine=29, maple=31, willow=74, dune=48, iris=99, umber=97, thyme=80, slate=51, amber=98, quartz=40.\nWhat is the last recorded number for iris?", + "answer": 99 + }, + { + "id": "test-latest-009", + "task": "latest", + "question": "Records in time order: elm=60, vine=67, amber=59, thyme=75, larch=86, elm=91, quartz=69, umber=80, grove=76, cedar=27, birch=30, pine=74.\nWhat is the last recorded number for elm?", + "answer": 91 + }, + { + "id": "test-latest-010", + "task": "latest", + "question": "Records in time order: heath=44, vine=23, nettle=42, amber=88, cedar=31, fern=72, vine=73, maple=58, kelp=41, birch=84, quartz=52, jade=63.\nWhat is the last recorded number for vine?", + "answer": 73 + }, + { + "id": "test-latest-011", + "task": "latest", + "question": "Records in time order: birch=59, grove=51, larch=49, yew=67, slate=31, amber=81, yew=96, vine=86, willow=60, dune=82, thyme=64, umber=33.\nWhat is the last recorded number for yew?", + "answer": 96 + }, + { + "id": "test-latest-012", + "task": "latest", + "question": "Records in time order: thyme=38, thyme=40, olive=80, amber=54, quartz=63, willow=60, yew=50, heath=36, nettle=81, iris=76, grove=88, vine=61.\nWhat is the last recorded number for thyme?", + "answer": 40 + }, + { + "id": "test-latest-013", + "task": "latest", + "question": "Records in time order: jade=31, birch=66, grove=46, slate=68, cedar=85, slate=76, kelp=22, yew=23, pine=63, olive=95, larch=55, vine=54.\nWhat is the last recorded number for slate?", + "answer": 76 + }, + { + "id": "test-latest-014", + "task": "latest", + "question": "Records in time order: heath=27, nettle=23, maple=73, vine=42, birch=62, elm=87, grove=24, birch=49, fern=86, umber=95, pine=81, slate=33.\nWhat is the last recorded number for birch?", + "answer": 49 + }, + { + "id": "test-latest-015", + "task": "latest", + "question": "Records in time order: larch=61, dune=83, elm=26, grove=42, larch=28, vine=25, umber=50, slate=77, yew=32, willow=35, kelp=41, cedar=48.\nWhat is the last recorded number for larch?", + "answer": 28 + }, + { + "id": "test-latest-016", + "task": "latest", + "question": "Records in time order: iris=62, elm=81, fern=63, amber=20, thyme=26, willow=48, dune=46, maple=83, maple=21, cedar=54, pine=91, jade=45.\nWhat is the last recorded number for maple?", + "answer": 21 + }, + { + "id": "test-latest-017", + "task": "latest", + "question": "Records in time order: amber=58, grove=42, kelp=99, kelp=73, umber=75, iris=82, olive=77, birch=21, cedar=64, fern=55, slate=54, pine=69.\nWhat is the last recorded number for kelp?", + "answer": 73 + }, + { + "id": "test-latest-018", + "task": "latest", + "question": "Records in time order: nettle=95, pine=30, elm=94, quartz=59, yew=87, larch=45, birch=91, cedar=58, vine=82, reed=25, yew=80, amber=75.\nWhat is the last recorded number for yew?", + "answer": 80 + }, + { + "id": "test-latest-019", + "task": "latest", + "question": "Records in time order: larch=58, quartz=94, nettle=59, larch=83, kelp=28, grove=66, thyme=20, vine=45, amber=62, willow=22, iris=81, heath=90.\nWhat is the last recorded number for larch?", + "answer": 83 + }, + { + "id": "test-latest-020", + "task": "latest", + "question": "Records in time order: slate=93, fern=24, nettle=70, maple=43, cedar=45, thyme=59, jade=25, heath=42, birch=38, iris=90, heath=77, grove=73.\nWhat is the last recorded number for heath?", + "answer": 77 + }, + { + "id": "test-latest-021", + "task": "latest", + "question": "Records in time order: fern=96, grove=34, iris=46, umber=43, reed=56, cedar=76, larch=49, maple=27, grove=37, willow=92, heath=45, kelp=28.\nWhat is the last recorded number for grove?", + "answer": 37 + }, + { + "id": "test-latest-022", + "task": "latest", + "question": "Records in time order: quartz=33, olive=22, kelp=84, reed=28, larch=93, yew=54, fern=69, grove=58, amber=38, jade=60, reed=56, heath=68.\nWhat is the last recorded number for reed?", + "answer": 56 + }, + { + "id": "test-latest-023", + "task": "latest", + "question": "Records in time order: kelp=33, kelp=92, fern=28, maple=88, vine=75, willow=89, pine=64, cedar=85, elm=72, dune=82, jade=62, quartz=74.\nWhat is the last recorded number for kelp?", + "answer": 92 + }, + { + "id": "test-latest-024", + "task": "latest", + "question": "Records in time order: reed=87, thyme=52, reed=76, kelp=82, nettle=39, grove=54, willow=67, quartz=45, amber=37, heath=73, slate=80, elm=48.\nWhat is the last recorded number for reed?", + "answer": 76 + }, + { + "id": "test-latest-025", + "task": "latest", + "question": "Records in time order: quartz=83, umber=43, nettle=27, slate=24, cedar=84, grove=99, pine=26, thyme=61, grove=97, fern=79, elm=40, iris=78.\nWhat is the last recorded number for grove?", + "answer": 97 + }, + { + "id": "test-latest-026", + "task": "latest", + "question": "Records in time order: vine=28, pine=42, heath=83, jade=63, iris=65, cedar=90, olive=69, birch=60, elm=54, cedar=21, amber=96, nettle=49.\nWhat is the last recorded number for cedar?", + "answer": 21 + }, + { + "id": "test-latest-027", + "task": "latest", + "question": "Records in time order: willow=85, willow=55, kelp=97, olive=70, dune=20, maple=83, birch=93, nettle=30, cedar=80, amber=51, slate=71, umber=64.\nWhat is the last recorded number for willow?", + "answer": 55 + }, + { + "id": "test-latest-028", + "task": "latest", + "question": "Records in time order: pine=40, nettle=25, maple=92, slate=28, larch=85, heath=57, amber=74, heath=21, fern=58, reed=46, vine=87, kelp=73.\nWhat is the last recorded number for heath?", + "answer": 21 + }, + { + "id": "test-latest-029", + "task": "latest", + "question": "Records in time order: larch=79, larch=82, amber=85, birch=52, maple=37, grove=83, yew=77, nettle=87, cedar=21, jade=62, vine=29, pine=38.\nWhat is the last recorded number for larch?", + "answer": 82 + }, + { + "id": "test-latest-030", + "task": "latest", + "question": "Records in time order: maple=71, birch=99, birch=97, heath=60, willow=45, cedar=96, amber=65, pine=31, kelp=75, nettle=36, fern=46, yew=88.\nWhat is the last recorded number for birch?", + "answer": 97 + }, + { + "id": "test-latest-031", + "task": "latest", + "question": "Records in time order: dune=55, kelp=26, yew=91, thyme=44, elm=63, reed=68, heath=81, olive=32, quartz=75, reed=71, cedar=90, larch=54.\nWhat is the last recorded number for reed?", + "answer": 71 + }, + { + "id": "test-addition-000", + "task": "addition", + "question": "What is 29 plus 76?", + "answer": 105 + }, + { + "id": "test-addition-001", + "task": "addition", + "question": "What is 62 plus 70?", + "answer": 132 + }, + { + "id": "test-addition-002", + "task": "addition", + "question": "What is 54 plus 68?", + "answer": 122 + }, + { + "id": "test-addition-003", + "task": "addition", + "question": "What is 23 plus 31?", + "answer": 54 + }, + { + "id": "test-addition-004", + "task": "addition", + "question": "What is 36 plus 57?", + "answer": 93 + }, + { + "id": "test-addition-005", + "task": "addition", + "question": "What is 25 plus 32?", + "answer": 57 + }, + { + "id": "test-addition-006", + "task": "addition", + "question": "What is 74 plus 76?", + "answer": 150 + }, + { + "id": "test-addition-007", + "task": "addition", + "question": "What is 41 plus 69?", + "answer": 110 + }, + { + "id": "test-addition-008", + "task": "addition", + "question": "What is 70 plus 86?", + "answer": 156 + }, + { + "id": "test-addition-009", + "task": "addition", + "question": "What is 30 plus 78?", + "answer": 108 + }, + { + "id": "test-addition-010", + "task": "addition", + "question": "What is 47 plus 69?", + "answer": 116 + }, + { + "id": "test-addition-011", + "task": "addition", + "question": "What is 74 plus 89?", + "answer": 163 + }, + { + "id": "test-addition-012", + "task": "addition", + "question": "What is 23 plus 41?", + "answer": 64 + }, + { + "id": "test-addition-013", + "task": "addition", + "question": "What is 59 plus 80?", + "answer": 139 + }, + { + "id": "test-addition-014", + "task": "addition", + "question": "What is 30 plus 67?", + "answer": 97 + }, + { + "id": "test-addition-015", + "task": "addition", + "question": "What is 45 plus 73?", + "answer": 118 + }, + { + "id": "test-addition-016", + "task": "addition", + "question": "What is 38 plus 39?", + "answer": 77 + }, + { + "id": "test-addition-017", + "task": "addition", + "question": "What is 37 plus 61?", + "answer": 98 + }, + { + "id": "test-addition-018", + "task": "addition", + "question": "What is 33 plus 39?", + "answer": 72 + }, + { + "id": "test-addition-019", + "task": "addition", + "question": "What is 31 plus 56?", + "answer": 87 + }, + { + "id": "test-addition-020", + "task": "addition", + "question": "What is 60 plus 81?", + "answer": 141 + }, + { + "id": "test-addition-021", + "task": "addition", + "question": "What is 44 plus 81?", + "answer": 125 + }, + { + "id": "test-addition-022", + "task": "addition", + "question": "What is 39 plus 44?", + "answer": 83 + }, + { + "id": "test-addition-023", + "task": "addition", + "question": "What is 48 plus 59?", + "answer": 107 + }, + { + "id": "test-addition-024", + "task": "addition", + "question": "What is 23 plus 64?", + "answer": 87 + }, + { + "id": "test-addition-025", + "task": "addition", + "question": "What is 52 plus 82?", + "answer": 134 + }, + { + "id": "test-addition-026", + "task": "addition", + "question": "What is 33 plus 84?", + "answer": 117 + }, + { + "id": "test-addition-027", + "task": "addition", + "question": "What is 21 plus 65?", + "answer": 86 + }, + { + "id": "test-addition-028", + "task": "addition", + "question": "What is 26 plus 52?", + "answer": 78 + }, + { + "id": "test-addition-029", + "task": "addition", + "question": "What is 33 plus 41?", + "answer": 74 + }, + { + "id": "test-addition-030", + "task": "addition", + "question": "What is 24 plus 70?", + "answer": 94 + }, + { + "id": "test-addition-031", + "task": "addition", + "question": "What is 59 plus 69?", + "answer": 128 + }, + { + "id": "test-count-000", + "task": "count", + "question": "Items: cedar, cedar, cedar, cedar, cedar, vine, vine, cedar, cedar, vine, cedar, cedar, cedar, vine, cedar, vine, cedar.\nHow many items are exactly 'cedar'?", + "answer": 12 + }, + { + "id": "test-count-001", + "task": "count", + "question": "Items: grove, cedar, grove, grove, cedar, cedar, grove, grove, grove, grove, grove, grove, grove, grove, grove, grove, grove, grove.\nHow many items are exactly 'grove'?", + "answer": 15 + }, + { + "id": "test-count-002", + "task": "count", + "question": "Items: dune, dune, thyme, dune, thyme, dune, dune, dune, dune, thyme, dune, dune, dune, dune.\nHow many items are exactly 'dune'?", + "answer": 11 + }, + { + "id": "test-count-003", + "task": "count", + "question": "Items: willow, fern, fern, willow, fern, willow, willow, willow, willow, fern, willow, fern, fern, willow, willow, willow, fern, willow, willow, fern, willow.\nHow many items are exactly 'willow'?", + "answer": 13 + }, + { + "id": "test-count-004", + "task": "count", + "question": "Items: dune, dune, dune, dune, vine, dune, dune, dune, vine, vine, dune, dune, vine, dune, vine, vine, dune, dune, dune, vine, vine, dune.\nHow many items are exactly 'dune'?", + "answer": 14 + }, + { + "id": "test-count-005", + "task": "count", + "question": "Items: vine, quartz, quartz, vine, quartz, vine, quartz, quartz, quartz, quartz, quartz, vine, quartz, quartz, vine, quartz, vine, quartz, quartz, vine, quartz.\nHow many items are exactly 'quartz'?", + "answer": 14 + }, + { + "id": "test-count-006", + "task": "count", + "question": "Items: fern, fern, quartz, quartz, quartz, quartz, fern, quartz, quartz, fern, fern, quartz, quartz, fern, quartz, fern, quartz, fern, quartz, quartz, quartz.\nHow many items are exactly 'quartz'?", + "answer": 13 + }, + { + "id": "test-count-007", + "task": "count", + "question": "Items: reed, reed, reed, thyme, thyme, reed, reed, reed, thyme, reed, reed, reed, thyme, reed, reed, reed, thyme, reed, thyme.\nHow many items are exactly 'reed'?", + "answer": 13 + }, + { + "id": "test-count-008", + "task": "count", + "question": "Items: heath, olive, olive, heath, heath, heath, olive, heath, olive, heath, heath, heath, olive, heath, heath, heath, heath, olive, heath, heath, heath.\nHow many items are exactly 'heath'?", + "answer": 15 + }, + { + "id": "test-count-009", + "task": "count", + "question": "Items: birch, birch, vine, birch, birch, birch, birch, birch, birch, vine, vine, birch, vine, vine, vine, birch, birch, vine, birch, birch.\nHow many items are exactly 'birch'?", + "answer": 13 + }, + { + "id": "test-count-010", + "task": "count", + "question": "Items: willow, slate, slate, willow, slate, slate, slate, willow, slate, slate, willow, willow, willow, slate, willow, willow, willow, slate, willow, willow, willow.\nHow many items are exactly 'willow'?", + "answer": 12 + }, + { + "id": "test-count-011", + "task": "count", + "question": "Items: heath, heath, heath, heath, umber, umber, umber, umber, umber, heath, heath, heath, umber, heath, heath, heath, umber, heath, heath.\nHow many items are exactly 'heath'?", + "answer": 12 + }, + { + "id": "test-count-012", + "task": "count", + "question": "Items: birch, grove, grove, grove, grove, grove, grove, grove, birch, grove, birch, grove, grove, birch, birch, birch, birch, grove, grove, grove.\nHow many items are exactly 'grove'?", + "answer": 13 + }, + { + "id": "test-count-013", + "task": "count", + "question": "Items: pine, pine, pine, pine, pine, pine, thyme, thyme, thyme, thyme, thyme, thyme, pine, pine, pine, pine, thyme, thyme, thyme.\nHow many items are exactly 'pine'?", + "answer": 10 + }, + { + "id": "test-count-014", + "task": "count", + "question": "Items: amber, slate, amber, slate, slate, amber, amber, amber, amber, amber, amber, slate, amber, slate, slate, slate, amber, slate.\nHow many items are exactly 'amber'?", + "answer": 10 + }, + { + "id": "test-count-015", + "task": "count", + "question": "Items: jade, jade, jade, jade, slate, slate, jade, jade, jade, jade, jade, jade, jade, slate.\nHow many items are exactly 'jade'?", + "answer": 11 + }, + { + "id": "test-count-016", + "task": "count", + "question": "Items: dune, dune, dune, dune, dune, dune, dune, dune, dune, dune, dune, dune, amber, dune, amber, amber, dune.\nHow many items are exactly 'dune'?", + "answer": 14 + }, + { + "id": "test-count-017", + "task": "count", + "question": "Items: willow, dune, willow, willow, willow, dune, dune, dune, dune, dune, willow, dune, dune, dune, dune.\nHow many items are exactly 'dune'?", + "answer": 10 + }, + { + "id": "test-count-018", + "task": "count", + "question": "Items: birch, willow, willow, willow, willow, willow, birch, birch, willow, birch, willow, willow, birch, birch, willow, willow, birch, willow, willow, birch, willow.\nHow many items are exactly 'willow'?", + "answer": 13 + }, + { + "id": "test-count-019", + "task": "count", + "question": "Items: iris, quartz, quartz, quartz, quartz, quartz, quartz, quartz, quartz, quartz, quartz, iris, iris, quartz, quartz.\nHow many items are exactly 'quartz'?", + "answer": 12 + }, + { + "id": "test-count-020", + "task": "count", + "question": "Items: yew, quartz, quartz, quartz, quartz, yew, quartz, yew, quartz, quartz, quartz, quartz, yew, quartz, quartz, quartz, quartz, quartz, yew, yew.\nHow many items are exactly 'quartz'?", + "answer": 14 + }, + { + "id": "test-count-021", + "task": "count", + "question": "Items: kelp, heath, kelp, kelp, heath, heath, heath, kelp, kelp, kelp, heath, kelp, kelp, kelp, kelp, kelp, kelp, heath, kelp, kelp, heath.\nHow many items are exactly 'kelp'?", + "answer": 14 + }, + { + "id": "test-count-022", + "task": "count", + "question": "Items: maple, elm, maple, elm, maple, maple, maple, elm, maple, elm, elm, maple, elm, elm, elm, elm, elm.\nHow many items are exactly 'elm'?", + "answer": 10 + }, + { + "id": "test-count-023", + "task": "count", + "question": "Items: cedar, cedar, kelp, kelp, kelp, cedar, kelp, kelp, kelp, kelp, kelp, kelp, cedar, kelp, cedar, kelp, kelp, cedar, cedar, kelp, cedar, kelp.\nHow many items are exactly 'kelp'?", + "answer": 14 + }, + { + "id": "test-count-024", + "task": "count", + "question": "Items: kelp, fern, fern, kelp, kelp, fern, kelp, fern, fern, kelp, fern, fern, kelp, fern, fern, fern, fern, fern, kelp, kelp.\nHow many items are exactly 'fern'?", + "answer": 12 + }, + { + "id": "test-count-025", + "task": "count", + "question": "Items: vine, jade, vine, jade, jade, vine, jade, vine, vine, vine, vine, jade, jade, jade, jade, vine, vine, vine, vine, vine, vine.\nHow many items are exactly 'vine'?", + "answer": 13 + }, + { + "id": "test-count-026", + "task": "count", + "question": "Items: birch, thyme, thyme, thyme, birch, thyme, birch, thyme, thyme, thyme, thyme, thyme, thyme, thyme, birch, birch, birch, birch, thyme, thyme, thyme, birch, thyme.\nHow many items are exactly 'thyme'?", + "answer": 15 + }, + { + "id": "test-count-027", + "task": "count", + "question": "Items: heath, pine, pine, heath, pine, heath, pine, heath, heath, pine, pine, pine, heath, pine, pine, heath, heath, pine, pine, pine, pine, pine, heath.\nHow many items are exactly 'pine'?", + "answer": 14 + }, + { + "id": "test-count-028", + "task": "count", + "question": "Items: reed, heath, heath, reed, reed, heath, heath, reed, heath, reed, reed, heath, heath, reed, heath, reed, reed, reed.\nHow many items are exactly 'reed'?", + "answer": 10 + }, + { + "id": "test-count-029", + "task": "count", + "question": "Items: pine, pine, grove, pine, grove, pine, pine, pine, pine, pine, grove, grove, pine, pine, grove, grove, pine, pine, grove, pine.\nHow many items are exactly 'pine'?", + "answer": 13 + }, + { + "id": "test-count-030", + "task": "count", + "question": "Items: fern, jade, fern, fern, jade, jade, fern, fern, fern, fern, fern, fern, jade, jade, fern, fern, jade, fern.\nHow many items are exactly 'fern'?", + "answer": 12 + }, + { + "id": "test-count-031", + "task": "count", + "question": "Items: pine, olive, olive, pine, pine, pine, pine, pine, pine, pine, pine, olive, pine, pine, olive, pine, olive, pine, pine, pine.\nHow many items are exactly 'pine'?", + "answer": 15 + } + ] + } +} diff --git a/results/lisa-full-answer-reproduction/preflight.json b/results/lisa-full-answer-reproduction/preflight.json new file mode 100644 index 0000000..7746d72 --- /dev/null +++ b/results/lisa-full-answer-reproduction/preflight.json @@ -0,0 +1,5 @@ +{ + "prompt_id": "screen-lookup-000", + "prompt_tokens": 103, + "tail_hidden_max_abs": 0.0001049041748046875 +} diff --git a/tests/test_lisa_full_answer.py b/tests/test_lisa_full_answer.py new file mode 100644 index 0000000..2596832 --- /dev/null +++ b/tests/test_lisa_full_answer.py @@ -0,0 +1,43 @@ +"""Protect final-answer scoring, split isolation and the screening threshold.""" +import unittest + +from crossqkv.lisa_full_answer import SCHEDULES, choose, final_integer, fixed_problems, grade +from crossqkv.lisa_full_answer_train import audit + + +class FullAnswerTests(unittest.TestCase): + def test_reads_the_terminal_answer_and_requires_eos(self): + self.assertEqual(final_integer('First try 17.\n42'), 42) + self.assertEqual(final_integer('Working: 17 and 25.\nFinal answer: 42.'), 42) + self.assertIsNone(final_integer('17 or 42')) + self.assertIsNone(final_integer('17')) + self.assertIsNone(final_integer('\nFinal answer: 42')) + + class TextTokenizer: + def decode(self, tokens, skip_special_tokens): + return ''.join(tokens) + + tok = TextTokenizer() + self.assertTrue(grade(tok, ['4', '2', ''], 'eos', 42)['correct']) + self.assertFalse(grade(tok, ['4', '2'], 'max_new_tokens', 42)['correct']) + + def test_frozen_splits_are_disjoint_and_schedule_must_lose_answers(self): + data = fixed_problems() + questions = [row['question'] for rows in data.values() for row in rows] + self.assertEqual(len(questions), len(set(questions))) + self.assertTrue(all(row['answer'] >= 10 for rows in data.values() for row in rows)) + a = {name: {'correct': 6, 'native_correct_to_wrong_integer': []} for name in SCHEDULES} + self.assertIsNone(choose({'lookup': a})) + a['direct_4']['native_correct_to_wrong_integer'] = ['a', 'b'] + self.assertEqual(choose({'lookup': a})['recipients'], [11, 15, 19, 23]) + + def test_audit_distinguishes_wrong_numbers_and_missing_answers(self): + def row(name, direct): + return {'id': name, 'arms': {'native': {'answer': 12, 'correct': True}, + 'direct': {'answer': direct, 'correct': False}, + 'lisa': {'answer': 12, 'correct': True}}} + + report = audit([row('wrong', 13), row('missing', None)]) + self.assertEqual(report['rescued'], 2) + self.assertEqual(report['substantive_loss_ids'], ['wrong']) + self.assertEqual(report['substantive_rescued_ids'], ['wrong']) diff --git a/tests/test_lisa_tail.py b/tests/test_lisa_tail.py index 8373cbb..c82914c 100644 --- a/tests/test_lisa_tail.py +++ b/tests/test_lisa_tail.py @@ -7,6 +7,7 @@ from torch.nn import functional as F from crossqkv.lisa_decode import AttentionSiteCache from crossqkv.lisa_decode_bench import ResidentSite, timed_site +from crossqkv.lisa_generate import GenerationDecoder from crossqkv.lisa_tail import FrozenLinear, TorchTail, gated_delta, rotate from crossqkv.lisa_train import LearnableSharingAttention from functional.model import PREFIX, delta_rule, rope @@ -85,6 +86,17 @@ class TailTests(unittest.TestCase): lengths = torch.tensor([5, 5]) native, _ = tail(h, None, lengths, 'native', ()) torch.testing.assert_close(native, torch.tensor(expected), atol=2e-5, rtol=2e-5) + padded = np.stack([ids[0], np.concatenate(([0, 0], ids[1, 2:]))]) + for mode, schedules, modules in ( + ('direct', [(), (2,)], None), ('lisa', [(2,), (2,)], {2: adapters[2]}) + ): + decoder = GenerationDecoder(original, schedules, [0, 2], modules) + actual = torch.cat((decoder.advance(torch.tensor(padded[:, :4])), + decoder.advance(torch.tensor(padded[:, 4:]))), dim=1) + for bi, pad in enumerate((0, 2)): + x = h[bi:bi+1, pad:] + ref, _ = tail(x, None, torch.tensor([5-pad]), mode, schedules[bi]) + torch.testing.assert_close(actual[bi:bi+1, pad:], ref, atol=2e-6, rtol=2e-5) donor = torch.tensor(rand(2, 2, 5, 5)) run, _ = tail(h, donor, lengths, 'lisa', (0,2), keep_teacher=False) ref, _ = tail(h, donor, lengths, 'lisa', (0,2), keep_teacher=True) diff --git a/tests/test_lisa_train.py b/tests/test_lisa_train.py index ea4f280..1bfce85 100644 --- a/tests/test_lisa_train.py +++ b/tests/test_lisa_train.py @@ -43,6 +43,20 @@ class LiSATrainingTests(unittest.TestCase): torch.testing.assert_close(torch.autograd.grad(streamed, h)[0], torch.autograd.grad(dense, h)[0]) + def test_completion_loss_covers_all_reply_tokens(self): + h = torch.randn((2, 6, 3), generator=torch.Generator().manual_seed(4), + requires_grad=True) + w = torch.randn((8, 3), generator=torch.Generator().manual_seed(5)) + ids = torch.tensor([[1, 2, 1, 4, 2, 7], [1, 3, 5, 7, 0, 0]]) + lengths, starts = torch.tensor([6, 4]), torch.tensor([3, 2]) + valid = (torch.arange(1, 6) < lengths[:, None]) & (torch.arange(1, 6) >= starts[:, None]) + reference = F.cross_entropy(F.linear(h[:, :-1][valid], w), ids[:, 1:][valid]) + streamed = language_model_loss(h, ids, lengths, lambda: iter([(0, w)]), + completion_starts=starts) + torch.testing.assert_close(streamed, reference) + torch.testing.assert_close(torch.autograd.grad(streamed, h)[0], + torch.autograd.grad(reference, h)[0]) + def test_causality_and_gradients_for_both_adapter_components(self): torch.manual_seed(9) a = LearnableSharingAttention(8, 2, 1, 8, 10000, .25, width=10) From c53d78b4aa91f2a10701843507394392618e0576 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 16:12:37 +0800 Subject: [PATCH 2/7] Keep deep sharing generation within host memory guards --- crossqkv/lisa_full_answer.py | 3 +-- crossqkv/lisa_full_answer_train.py | 4 ++-- crossqkv/lisa_generate.py | 4 ++++ docs/LISA_FULL_ANSWER_PROTOCOL.md | 2 +- functional/model.py | 5 +++-- results/lisa-full-answer-reproduction/code.sha256 | 8 ++++---- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/crossqkv/lisa_full_answer.py b/crossqkv/lisa_full_answer.py index 4afadc1..6b44303 100644 --- a/crossqkv/lisa_full_answer.py +++ b/crossqkv/lisa_full_answer.py @@ -23,7 +23,6 @@ SCHEDULES = {'native': (), 'direct_3': (15, 19, 23), 'direct_4': (11, 15, 19, 23), 'direct_5': (7, 11, 15, 19, 23)} STOP_TEXT = ('<|im_end|>', '<|endoftext|>') MAX_NEW_TOKENS = 24 -PROCESS_SWAP_LIMIT_KIB = 384 * 1024 def fixed_problems(): @@ -172,7 +171,7 @@ def main(): raise ValueError('Frozen protocol or prompts changed') write_json(manifest, frozen) model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()), - seconds=args.seconds, process_swap_limit_kib=PROCESS_SWAP_LIMIT_KIB) + seconds=args.seconds, process_swap_limit_kib=None) tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json')) examples = frozen['problems']['screen'] if args.preflight: diff --git a/crossqkv/lisa_full_answer_train.py b/crossqkv/lisa_full_answer_train.py index 4053d40..f360121 100644 --- a/crossqkv/lisa_full_answer_train.py +++ b/crossqkv/lisa_full_answer_train.py @@ -8,7 +8,7 @@ import torch from tokenizers import Tokenizer from crossqkv.lisa_effect_audit import paired -from crossqkv.lisa_full_answer import (PROCESS_SWAP_LIMIT_KIB, SCHEDULES, STOP_TEXT, choose, evaluate, fingerprint, +from crossqkv.lisa_full_answer import (SCHEDULES, STOP_TEXT, choose, evaluate, fingerprint, prompt, summarize) from crossqkv.lisa_tail import TorchTail, weight_chunks from crossqkv.lisa_train import LearnableSharingAttention, huber_distillation, language_model_loss @@ -181,7 +181,7 @@ def main(): tasks = {name: [r for r in rows if r['task'] == selection['task']] for name, rows in manifest['problems'].items()} model = StreamingLM(args.source/'weights', json.loads((args.source/'model_config.json').read_text()), - seconds=86400, process_swap_limit_kib=PROCESS_SWAP_LIMIT_KIB) + seconds=86400, process_swap_limit_kib=None) model.sites = sites tokenizer = Tokenizer.from_file(str(args.source/'tokenizer.json')) capture(model, tokenizer, tasks['fit'], args.out/'fit-capture') diff --git a/crossqkv/lisa_generate.py b/crossqkv/lisa_generate.py index af1d634..fac59b9 100644 --- a/crossqkv/lisa_generate.py +++ b/crossqkv/lisa_generate.py @@ -73,6 +73,7 @@ class GenerationDecoder(TorchTail): k_valid[:, None, None, :] | ~q_valid[:, None, :, None]) h = torch.from_numpy(self.source.embedding(ids.numpy())) * q_valid[..., None] donor = None + trim = getattr(self.source, 'malloc_trim', None) for layer, kind in enumerate(self.c['layer_types']): if hasattr(self.source, 'guard'): self.source.guard() @@ -86,6 +87,9 @@ class GenerationDecoder(TorchTail): n = self.norm(h, p+'post_attention_layernorm') activation = F.silu(self.linear(n, p+'mlp.gate_proj')) * self.linear(n, p+'mlp.up_proj') h = h + self.linear(activation, p+'mlp.down_proj') + del n, out, activation + if trim is not None: + trim(0) self.position = stop return self.norm(h, 'norm') diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md index 173c620..bcf36c0 100644 --- a/docs/LISA_FULL_ANSWER_PROTOCOL.md +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -34,4 +34,4 @@ RESULT=runs/NEW_FULL_ANSWER_RESULT 使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。 -服务器约有 1.7 GiB 内存。本轮每次筛选只输入一道题,四个配置共享一次权重读取。PyTorch 进程在前两次预检中累计换页约 230 MiB,在服务器仍有约 1 GiB 可用内存时被退出。第三次预检沿用同一批冻结题,换页上限设为 384 MiB,保留服务器可用内存、进程 RSS 及运行时间检查。 +服务器约有 1.7 GiB 内存。本轮每次筛选输入一道题,四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。 diff --git a/functional/model.py b/functional/model.py index 3f1a32a..1da2671 100644 --- a/functional/model.py +++ b/functional/model.py @@ -109,8 +109,9 @@ class StreamingLM: rate = (count-self.swap_observation[1])*4096/elapsed self.swap_pressure_windows = self.swap_pressure_windows+1 if rate > 4*1024**2 else 0 own_swap_kib = int(status.get('VmSwap', '0 kB').split()[0]) - if self.swap_pressure_windows >= 3 and ( - available < 384*1024 or own_swap_kib > self.process_swap_limit_kib): + over_process_limit = (self.process_swap_limit_kib is not None + and own_swap_kib > self.process_swap_limit_kib) + if self.swap_pressure_windows >= 3 and (available < 384*1024 or over_process_limit): raise MemoryError(f'Sustained host swap pressure plus constrained memory: available={available} KiB, process_swap={own_swap_kib} KiB') self.swap_observation = (now,count) if rss_kib > 512*1024 or available < 256*1024: diff --git a/results/lisa-full-answer-reproduction/code.sha256 b/results/lisa-full-answer-reproduction/code.sha256 index 57fb75b..88f6c78 100644 --- a/results/lisa-full-answer-reproduction/code.sha256 +++ b/results/lisa-full-answer-reproduction/code.sha256 @@ -1,7 +1,7 @@ -a8ad25f70b2ccabfb92b82f7288e02738361d31c010e0fc83a02b5f5ecaff76b functional/model.py -987420dbdd8b885821e7e7c09c38f0b34bf3651160857941554433adec645cc0 crossqkv/lisa_generate.py -890654f75ea0ccf3cb83e221d2cc99f4873dd8a6fc016ed43fde490c9f2621ba crossqkv/lisa_full_answer.py -97bb4882ec6949c2cf2528b97f2a6f00bc0c24194f72ebdc57bc1d3c810cd185 crossqkv/lisa_full_answer_train.py +94437e0138c54ec34b1beaaa0e08a334ce0822f60af598a5a896459b778a3a1c functional/model.py +98927a1ccd935b2f7a438bad31bbd973e210a54deceac911c61551092e52c96c crossqkv/lisa_generate.py +519e0a031efcfb69c9b86fca1cb649fe8bb93d799401c8023ff7b6549cded448 crossqkv/lisa_full_answer.py +74d6cbe3be94a8118f670c8810037b6d8abe085bd42b638a58af856eb45a17f3 crossqkv/lisa_full_answer_train.py d47b4c9cc34082e9b356e745821298a43981e4cd18ed55a3f59b4b6fe7cc46e3 crossqkv/lisa_tail.py 9f0b6a53f107950661e91c16f03b49440708b3936120e2f84ef1d66f185257b6 crossqkv/lisa_train.py 96d12fdfa266ca02ac50330971ff403e04b977358f479d63c8d6276a514fe025 tests/test_lisa_full_answer.py From 0f4c0a982cd8bf365f9ade6eae8a4e87385f34e2 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 16:34:33 +0800 Subject: [PATCH 3/7] Verify complete answers from archived generation tokens --- crossqkv/lisa_full_answer_verify.py | 73 ++++++++++++++ docs/LISA_FULL_ANSWER_PROTOCOL.md | 3 + .../first-screen-item.json | 94 +++++++++++++++++++ .../first-screen-verification.json | 5 + 4 files changed, 175 insertions(+) create mode 100644 crossqkv/lisa_full_answer_verify.py create mode 100644 results/lisa-full-answer-reproduction/first-screen-item.json create mode 100644 results/lisa-full-answer-reproduction/first-screen-verification.json diff --git a/crossqkv/lisa_full_answer_verify.py b/crossqkv/lisa_full_answer_verify.py new file mode 100644 index 0000000..1288096 --- /dev/null +++ b/crossqkv/lisa_full_answer_verify.py @@ -0,0 +1,73 @@ +"""Reconstruct complete-answer scores from the saved token streams.""" +import argparse +import json +from pathlib import Path + +from tokenizers import Tokenizer + +from crossqkv.lisa_full_answer import SCHEDULES, fingerprint, grade +from crossqkv.lisa_full_answer_train import audit +from functional.run import write_json + + +def verify(tokenizer, protocol, expected, rows, arms, allow_prefix=False): + """Validate each recorded model answer against its frozen prompt and token IDs.""" + if not rows or len(rows) > len(expected) or (not allow_prefix and len(rows) != len(expected)): + raise ValueError('Unexpected number of evaluated items') + stop_ids = {tokenizer.token_to_id(text) for text in protocol['stops']} + if None in stop_ids: + raise ValueError('Missing stop token in the frozen tokenizer') + for item, row in zip(expected, rows): + if (row['id'], row['task'], row['gold']) != (item['id'], item['task'], item['answer']): + raise ValueError(f"Unexpected row for {item['id']}") + if set(row['arms']) != set(arms): + raise ValueError(f"Unexpected arms for {item['id']}") + for arm in arms: + stored = row['arms'][arm] + tokens = stored['tokens'] + if (not 0 < len(tokens) <= protocol['cap'] + or any(type(token) is not int or tokenizer.id_to_token(token) is None + for token in tokens) + or any(token in stop_ids for token in tokens[:-1])): + raise ValueError(f"Invalid generated token stream for {item['id']} / {arm}") + ended = tokens[-1] in stop_ids + if not ended and len(tokens) != protocol['cap']: + raise ValueError(f"Generation ended before a stop or the cap for {item['id']} / {arm}") + score = grade(tokenizer, tokens, 'eos' if ended else 'max_new_tokens', item['answer']) + if stored != score: + raise ValueError(f"Archived score does not match the tokens for {item['id']} / {arm}") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + for name in ('tokenizer', 'frozen', 'rows', 'out'): + parser.add_argument('--'+name, required=True, type=Path) + parser.add_argument('--selection', type=Path, help='Verify the selected task on the test split') + parser.add_argument('--allow-screen-prefix', action='store_true') + args = parser.parse_args() + if args.selection and args.allow_screen_prefix: + parser.error('Test verification requires all frozen test rows') + frozen = json.loads(args.frozen.read_bytes()) + protocol = frozen['protocol'] + if fingerprint(args.tokenizer) != protocol['weights']['tokenizer.json']: + raise ValueError('Tokenizer differs from the frozen experiment') + rows = json.loads(args.rows.read_bytes()) + tokenizer = Tokenizer.from_file(str(args.tokenizer)) + report = {'frozen_sha256': fingerprint(args.frozen), 'rows_sha256': fingerprint(args.rows), + 'rows_verified': len(rows)} + if args.selection: + chosen = json.loads(args.selection.read_bytes()) + if chosen['frozen_sha256'] != report['frozen_sha256']: + raise ValueError('Selection points to a different frozen manifest') + expected = [item for item in frozen['problems']['test'] + if item['task'] == chosen['chosen']['task']] + verify(tokenizer, protocol, expected, rows, ('native', 'direct', 'lisa')) + report['final_answer_audit'] = audit(rows) + else: + verify(tokenizer, protocol, frozen['problems']['screen'], rows, SCHEDULES, + allow_prefix=args.allow_screen_prefix) + write_json(args.out, report) + + +if __name__ == '__main__': + main() diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md index bcf36c0..cc60305 100644 --- a/docs/LISA_FULL_ANSWER_PROTOCOL.md +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -30,6 +30,9 @@ RESULT=runs/NEW_FULL_ANSWER_RESULT "$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1 --preflight "$PYTHON" -B -m crossqkv.lisa_full_answer --source "$SOURCE" --out "$SCREEN" --batch-prompts 1 "$PYTHON" -B -m crossqkv.lisa_full_answer_train --source "$SOURCE" --screen "$SCREEN" --out "$RESULT" +"$PYTHON" -B -m crossqkv.lisa_full_answer_verify --tokenizer "$SOURCE/tokenizer.json" \ + --frozen "$SCREEN/frozen.json" --selection "$SCREEN/selection.json" \ + --rows "$RESULT/test-items.json" --out "$RESULT/verified-test.json" ``` 使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。 diff --git a/results/lisa-full-answer-reproduction/first-screen-item.json b/results/lisa-full-answer-reproduction/first-screen-item.json new file mode 100644 index 0000000..58267e9 --- /dev/null +++ b/results/lisa-full-answer-reproduction/first-screen-item.json @@ -0,0 +1,94 @@ +[ + { + "id": "screen-lookup-000", + "task": "lookup", + "gold": 82, + "arms": { + "native": { + "tokens": [ + 23, + 17, + 248046 + ], + "response": "82<|im_end|>", + "stop": "eos", + "answer": 82, + "correct": true + }, + "direct_3": { + "tokens": [ + 20, + 248044 + ], + "response": "5<|endoftext|>", + "stop": "eos", + "answer": 5, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1353, + 506, + 279, + 1103, + 314, + 4947, + 488, + 3766, + 25, + 271, + 332, + 16, + 13, + 220, + 16, + 332, + 198 + ], + "response": "To find the answer, let's look at the list of numbers you provided:\n\n**1. 1**\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + } +] diff --git a/results/lisa-full-answer-reproduction/first-screen-verification.json b/results/lisa-full-answer-reproduction/first-screen-verification.json new file mode 100644 index 0000000..a7eab59 --- /dev/null +++ b/results/lisa-full-answer-reproduction/first-screen-verification.json @@ -0,0 +1,5 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "rows_sha256": "630c27e010ac00677bd2e7a280f17e9076c802c245f4857ec8f6795418e00c3d", + "rows_verified": 1 +} From 2d1d28c331e8877b647ba3e666c2bb5b01125ee4 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 18:47:30 +0800 Subject: [PATCH 4/7] Resume answer screening with verified paired batching --- crossqkv/lisa_full_answer.py | 17 +++++++++++++++-- docs/LISA_FULL_ANSWER_PROTOCOL.md | 2 ++ .../batch-resume-code.sha256 | 1 + .../execution-batch-replay.json | 8 ++++++++ .../execution-handoff.json | 1 + 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 results/lisa-full-answer-reproduction/batch-resume-code.sha256 create mode 100644 results/lisa-full-answer-reproduction/execution-batch-replay.json create mode 100644 results/lisa-full-answer-reproduction/execution-handoff.json diff --git a/crossqkv/lisa_full_answer.py b/crossqkv/lisa_full_answer.py index 6b44303..e6a4c07 100644 --- a/crossqkv/lisa_full_answer.py +++ b/crossqkv/lisa_full_answer.py @@ -155,6 +155,8 @@ def main(): parser.add_argument('--out', required=True, type=Path) parser.add_argument('--seconds', default=21600, type=int) parser.add_argument('--batch-prompts', default=2, type=int, choices=(1, 2)) + parser.add_argument('--execution-batch-prompts', type=int, choices=(1, 2), + help='Use a different execution batch on resume after replaying completed rows') parser.add_argument('--preflight', action='store_true') args = parser.parse_args() torch.set_num_threads(1) @@ -193,8 +195,19 @@ def main(): rows = json.loads(path.read_text()) if path.exists() else [] if [r['id'] for r in rows] != [x['id'] for x in examples[:len(rows)]]: raise ValueError('Existing screen results do not match frozen prompts') - for start in range(len(rows), len(examples), args.batch_prompts): - rows.extend(evaluate(model, tokenizer, examples[start:start+args.batch_prompts], SCHEDULES)) + batch = args.execution_batch_prompts or args.batch_prompts + if batch != args.batch_prompts: + if len(rows) < batch: + raise ValueError('The alternate batch requires enough already evaluated prompts for replay') + replay = evaluate(model, tokenizer, examples[:batch], SCHEDULES) + if replay != rows[:batch]: + raise ValueError('Alternate batch changed the first completed token streams') + write_json(args.out/'execution-batch-replay.json', + {'frozen_sha256': fingerprint(manifest), 'batch_prompts': batch, + 'matched_rows': [row['id'] for row in replay]}) + print('validated execution batch', batch, flush=True) + for start in range(len(rows), len(examples), batch): + rows.extend(evaluate(model, tokenizer, examples[start:start+batch], SCHEDULES)) write_json(path, rows) print('screen complete', len(rows), '/', len(examples), flush=True) summary = summarize(rows) diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md index cc60305..0b2cf91 100644 --- a/docs/LISA_FULL_ANSWER_PROTOCOL.md +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -37,4 +37,6 @@ RESULT=runs/NEW_FULL_ANSWER_RESULT 使用原目录运行相同命令即可续跑。筛选和测试将按已保存的题号继续。训练使用已保存的优化器和训练步。 +筛选续跑可加 `--execution-batch-prompts 2`。它会重跑已完成的前两题,要求所有配置的 token 序列、停止原因与判分逐项一致,才继续处理剩余题目,并把回放凭证写入 `execution-batch-replay.json`。冻结的 `--batch-prompts 1` 参数仍用于校验原实验。双题模式超出资源限制或未通过回放时,可用原单题命令从已保存的行继续。本次在第五题写盘后交接,前两题的四个配置均通过了完整回放核对。 + 服务器约有 1.7 GiB 内存。本轮每次筛选输入一道题,四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。 diff --git a/results/lisa-full-answer-reproduction/batch-resume-code.sha256 b/results/lisa-full-answer-reproduction/batch-resume-code.sha256 new file mode 100644 index 0000000..eca8308 --- /dev/null +++ b/results/lisa-full-answer-reproduction/batch-resume-code.sha256 @@ -0,0 +1 @@ +07179a56936844f1bd639e1f31ee7f9d0110ec28c472fe6a59c7fcaf3e033355 crossqkv/lisa_full_answer.py diff --git a/results/lisa-full-answer-reproduction/execution-batch-replay.json b/results/lisa-full-answer-reproduction/execution-batch-replay.json new file mode 100644 index 0000000..59a6750 --- /dev/null +++ b/results/lisa-full-answer-reproduction/execution-batch-replay.json @@ -0,0 +1,8 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "batch_prompts": 2, + "matched_rows": [ + "screen-lookup-000", + "screen-lookup-001" + ] +} diff --git a/results/lisa-full-answer-reproduction/execution-handoff.json b/results/lisa-full-answer-reproduction/execution-handoff.json new file mode 100644 index 0000000..5bb7292 --- /dev/null +++ b/results/lisa-full-answer-reproduction/execution-handoff.json @@ -0,0 +1 @@ +{"rows": 5, "rows_sha256": "ff93a751537895e3d7fc55e3496afbbc46df34bb04ed89663319e38b8aa7a6e2", "stopped_pid": 4124128} From 4291cc207f86fc0369d07130a2d41da6a24595d0 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Wed, 25 Nov 2026 02:15:38 +0800 Subject: [PATCH 5/7] Archive full-answer screening and lock the LiSA schedule --- docs/LISA_FULL_ANSWER_PROTOCOL.md | 6 +- docs/LISA_FULL_ANSWER_RESULTS.md | 22 + .../screen-rows.json | 2640 +++++++++++++++++ .../screen-summary.json | 145 + .../selection.json | 13 + .../train-spec.json | 19 + .../verified-screen.json | 5 + 7 files changed, 2847 insertions(+), 3 deletions(-) create mode 100644 docs/LISA_FULL_ANSWER_RESULTS.md create mode 100644 results/lisa-full-answer-reproduction/screen-rows.json create mode 100644 results/lisa-full-answer-reproduction/screen-summary.json create mode 100644 results/lisa-full-answer-reproduction/selection.json create mode 100644 results/lisa-full-answer-reproduction/train-spec.json create mode 100644 results/lisa-full-answer-reproduction/verified-screen.json diff --git a/docs/LISA_FULL_ANSWER_PROTOCOL.md b/docs/LISA_FULL_ANSWER_PROTOCOL.md index 0b2cf91..0b0fc6f 100644 --- a/docs/LISA_FULL_ANSWER_PROTOCOL.md +++ b/docs/LISA_FULL_ANSWER_PROTOCOL.md @@ -6,13 +6,13 @@ 从 0 开始编号。接收层分别为 `[15, 19, 23]`、`[11, 15, 19, 23]` 和 `[7, 11, 15, 19, 23]`。每个接收层使用本次前向中前一全注意力层实际输出的分数。接收端保留自身的 V、门控和输出投影。原模型与三个直接共享配置配对生成。 -候选任务为表中数值查找、重复键最后值查找、两位数加法、重复项计数。固定生成器在运行筛选之前写出每类任务 8 道开发题、24 道训练题、8 道验证题和 32 道留出测试题。同一数值题跨数据划分去重,加法按交换律规范操作数。每个候选都要满足原模型至少答对 6/8 且至少 2 道原模型答对的题在直接共享下生成了错误整数。选择时依次比较数字错误数、原模型正确数和接收层数。完成了生成却没有可提取答案的情况单独记数。 +候选任务为表中数值查找、重复键最后值查找、两位数加法、重复项计数。固定生成器在运行筛选之前写出每类任务 8 道开发题、24 道训练题、8 道验证题和 32 道留出测试题。同一数值题跨数据划分去重,加法按交换律规范操作数。每个候选都要满足原模型至少答对 6/8 且至少 2 道原模型答对的题在直接共享下生成了错误整数。选择时依次比较数字错误数、原模型正确数和接收层数,仍并列时取字典序最大的任务标识。完成了生成却没有可提取答案的情况单独记数。 使用检查点发布的单轮聊天模板和关闭 thinking 的生成前缀。所有配置从全词表逐 token 贪心生成,遇到回合结束或文本结束 token 停止,最多生成 24 tokens。主要指标要求已生成停止 token,并从整条答复提取完整整数。接受纯整数或明确的最终答案行,可去掉开头完整的 thinking 区块。原始 token、文本、停止原因和提取值都随结果存档。 [检查点聊天模板](https://huggingface.co/Qwen/Qwen3.5-2B/blob/15852e8c16360a2fea060d615a32b45270f8a8fc/chat_template.jinja) ## LiSA 训练与测试 -开发筛选完成后用固定哈希验证题集、共享配置、原模型和筛选数据。仅在存在达标配置时启动训练。冻结原模型,只训练两个线性层组成的注意力头融合和 rank 40 的低秩 Q/K。用原模型在同一训练序列上的因果注意力分数作为教师。损失为 0.25 倍 Huber 距离加 0.75 倍全词表交叉熵,交叉熵覆盖参考答案的所有 token 和结束 token。每个训练样本更新后保存优化器和模型状态。验证集上生成完整答案,按正确数选择两轮中的最佳检查点,同分选较早者。 +开发筛选完成后用固定哈希验证题集、共享配置、原模型和筛选数据。仅在存在达标配置时启动训练。冻结原模型,只训练两个线性层组成的注意力头融合和 rank 40 的低秩 Q/K。用原模型在同一训练序列上的遮罩前注意力分数作为教师。损失为 0.25 倍 Huber 距离加 0.75 倍全词表交叉熵。Huber 覆盖实际序列长度内的所有查询和键,注意力前向应用因果遮罩。交叉熵覆盖参考答案的所有 token 和结束 token。每个训练样本更新后保存优化器和模型状态。验证集上生成完整答案,按正确数选择两轮中的最佳检查点,同分选较早者。 最终对同一批留出题的原模型、直接共享、训练后的 LiSA 分别生成并保存完整回答。报告准确率、直接共享造成的数值错误、其中被 LiSA 恢复的题、新增错误和缺少可提取答案的情况。准确率差按题配对估计,另报告 McNemar 精确双侧检验。 @@ -39,4 +39,4 @@ RESULT=runs/NEW_FULL_ANSWER_RESULT 筛选续跑可加 `--execution-batch-prompts 2`。它会重跑已完成的前两题,要求所有配置的 token 序列、停止原因与判分逐项一致,才继续处理剩余题目,并把回放凭证写入 `execution-batch-replay.json`。冻结的 `--batch-prompts 1` 参数仍用于校验原实验。双题模式超出资源限制或未通过回放时,可用原单题命令从已保存的行继续。本次在第五题写盘后交接,前两题的四个配置均通过了完整回放核对。 -服务器约有 1.7 GiB 内存。本轮每次筛选输入一道题,四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。 +服务器约有 1.7 GiB 内存。前五题采用单题批量,从第六题起采用通过回放的双题批量。每道题的四个配置共享权重读取。前两次预检和一次生成在服务器仍有约 1 GiB 可用内存时触发进程独立换页上限。当前作业沿用原冻结题集,并在每层结束时释放空闲内存。可用内存、进程 RSS、低可用内存下的持续换页压力和运行时间均由原检查器监控。 diff --git a/docs/LISA_FULL_ANSWER_RESULTS.md b/docs/LISA_FULL_ANSWER_RESULTS.md new file mode 100644 index 0000000..0747b2e --- /dev/null +++ b/docs/LISA_FULL_ANSWER_RESULTS.md @@ -0,0 +1,22 @@ +# 完整答案下的 3–5 层共享实验 + +开发集筛选选定表中数值查找和三个接收层 `[15, 19, 23]`,层号从 0 起算。原模型在查表组答对 8/8,3 层直接共享在这八题上都生成了用结束 token 收尾的错误整数。该条件用于后续 LiSA 训练和独立留出评估。 + +## 开发集筛选 + +每个任务各有八题。共享列依次列出正确数、原模型答对却在直接共享后得到错误整数的题数,以及未提取到答案的题数。 + +| 任务 | 原模型正确 | 3 层共享 | 4 层共享 | 5 层共享 | +| --- | ---: | ---: | ---: | ---: | +| 查表 | 8 | 0 / 8 / 0 | 0 / 4 / 4 | 0 / 0 / 8 | +| 重复键最后值 | 6 | 0 / 6 / 0 | 0 / 3 / 4 | 0 / 0 / 8 | +| 加法 | 7 | 0 / 7 / 0 | 0 / 1 / 7 | 0 / 0 / 8 | +| 重复项计数 | 1 | 1 / 1 / 0 | 0 / 1 / 0 | 0 / 0 / 8 | + +5 层配置的 32 道生成均达到 24-token 上限。3 层对查表、重复键和加法均达到筛选门槛,查表中从正确变成错误整数的题数最多。筛选结果用于选择条件。留出集将另行估计准确率差、恢复题和新增错误。 + +独立复核用原分词器重新解析 32 道题的全部四组 token 序列,核对终止原因和正确性。冻结清单、逐题生成、组内汇总、选择记录和训练配置均已归档。 [实验协议](LISA_FULL_ANSWER_PROTOCOL.md) · [原始数据](../results/lisa-full-answer-reproduction/) + +## 训练与独立留出评估 + +已启动三个接收层的 LiSA 训练流程。使用 24 道冻结拟合题和 8 道验证题,训练两轮,随后评估 32 道独立留出题。完整答案恢复率和配对区间待测试结束。 diff --git a/results/lisa-full-answer-reproduction/screen-rows.json b/results/lisa-full-answer-reproduction/screen-rows.json new file mode 100644 index 0000000..738ba35 --- /dev/null +++ b/results/lisa-full-answer-reproduction/screen-rows.json @@ -0,0 +1,2640 @@ +[ + { + "id": "screen-lookup-000", + "task": "lookup", + "gold": 82, + "arms": { + "native": { + "tokens": [ + 23, + 17, + 248046 + ], + "response": "82<|im_end|>", + "stop": "eos", + "answer": 82, + "correct": true + }, + "direct_3": { + "tokens": [ + 20, + 248044 + ], + "response": "5<|endoftext|>", + "stop": "eos", + "answer": 5, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1353, + 506, + 279, + 1103, + 314, + 4947, + 488, + 3766, + 25, + 271, + 332, + 16, + 13, + 220, + 16, + 332, + 198 + ], + "response": "To find the answer, let's look at the list of numbers you provided:\n\n**1. 1**\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-001", + "task": "lookup", + "gold": 47, + "arms": { + "native": { + "tokens": [ + 19, + 22, + 248046 + ], + "response": "47<|im_end|>", + "stop": "eos", + "answer": 47, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 18, + 248044 + ], + "response": "23<|endoftext|>", + "stop": "eos", + "answer": 23, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 3050, + 869, + 5634, + 440, + 279, + 3299, + 328, + 8286, + 1, + 303, + 279, + 3766, + 1414, + 13 + ], + "response": "To find the answer, I need to identify the specific value associated with the word \"record\" in the provided text.", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-002", + "task": "lookup", + "gold": 31, + "arms": { + "native": { + "tokens": [ + 18, + 16, + 248046 + ], + "response": "31<|im_end|>", + "stop": "eos", + "answer": 31, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 21, + 248044 + ], + "response": "26<|endoftext|>", + "stop": "eos", + "answer": 26, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 1324, + 5634, + 440, + 279, + 3299, + 328, + 3946, + 1, + 303, + 279, + 3766, + 1414, + 13, + 271 + ], + "response": "To find the answer, I need to identify the number associated with the word \"number\" in the provided text.\n\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-003", + "task": "lookup", + "gold": 51, + "arms": { + "native": { + "tokens": [ + 20, + 16, + 248046 + ], + "response": "51<|im_end|>", + "stop": "eos", + "answer": 51, + "correct": true + }, + "direct_3": { + "tokens": [ + 20, + 24, + 248044 + ], + "response": "59<|endoftext|>", + "stop": "eos", + "answer": 59, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 1324, + 5634, + 440, + 279, + 1324, + 328, + 16, + 1, + 303, + 279, + 3766, + 1414, + 13, + 271 + ], + "response": "To find the answer, I need to identify the number associated with the number \"1\" in the provided text.\n\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-004", + "task": "lookup", + "gold": 44, + "arms": { + "native": { + "tokens": [ + 19, + 19, + 248046 + ], + "response": "44<|im_end|>", + "stop": "eos", + "answer": 44, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 1324, + 5634, + 440, + 279, + 1324, + 328, + 16, + 15, + 15, + 1, + 303, + 279, + 3766, + 1414 + ], + "response": "To find the answer, I need to identify the number associated with the number \"100\" in the provided text", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-005", + "task": "lookup", + "gold": 22, + "arms": { + "native": { + "tokens": [ + 17, + 17, + 248046 + ], + "response": "22<|im_end|>", + "stop": "eos", + "answer": 22, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 23748, + 279, + 3050, + 869, + 5634, + 440, + 279, + 1455, + 328, + 265, + 25, + 265, + 25, + 265, + 25, + 265 + ], + "response": "To find the answer, I need to locate the specific value associated with the item \"re:re:re:re", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-006", + "task": "lookup", + "gold": 90, + "arms": { + "native": { + "tokens": [ + 24, + 15, + 248046 + ], + "response": "90<|im_end|>", + "stop": "eos", + "answer": 90, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 22, + 248044 + ], + "response": "27<|endoftext|>", + "stop": "eos", + "answer": 27, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 23748, + 279, + 3050, + 869, + 5634, + 440, + 279, + 1455, + 328, + 75, + 862, + 1, + 303, + 279, + 3766, + 1414 + ], + "response": "To find the answer, I need to locate the specific value associated with the item \"lumber\" in the provided text", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-lookup-007", + "task": "lookup", + "gold": 87, + "arms": { + "native": { + "tokens": [ + 23, + 22, + 248046 + ], + "response": "87<|im_end|>", + "stop": "eos", + "answer": 87, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 1324, + 5634, + 440, + 279, + 3299, + 328, + 3946, + 1, + 303, + 279, + 3766, + 1414, + 13, + 271 + ], + "response": "To find the answer, I need to identify the number associated with the word \"number\" in the provided text.\n\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-000", + "task": "latest", + "gold": 40, + "arms": { + "native": { + "tokens": [ + 19, + 15, + 248046 + ], + "response": "40<|im_end|>", + "stop": "eos", + "answer": 40, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 248044 + ], + "response": "2<|endoftext|>", + "stop": "eos", + "answer": 2, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 3134, + 3018, + 383, + 279, + 3766, + 1414, + 13, + 271, + 16, + 13, + 220, + 2972, + 2014, + 53983 + ], + "response": "To find the answer, let's break down the query based on the provided text.\n\n1. **Analyze", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-001", + "task": "latest", + "gold": 53, + "arms": { + "native": { + "tokens": [ + 20, + 18, + 248046 + ], + "response": "53<|im_end|>", + "stop": "eos", + "answer": 53, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 353, + 1144, + 310, + 10229, + 279, + 3050, + 869, + 5634, + 440, + 279, + 3134, + 328, + 3710, + 369, + 279, + 1483, + 1324, + 1076, + 3158 + ], + "response": "To find the answer, I need to identify the specific value associated with the query \"What is the last number...\".", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-002", + "task": "latest", + "gold": 87, + "arms": { + "native": { + "tokens": [ + 22, + 16, + 248046 + ], + "response": "71<|im_end|>", + "stop": "eos", + "answer": 71, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ], + "response": "100000000000000000000000", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1622, + 3018, + 383, + 279, + 3766, + 1414, + 25, + 271, + 16, + 13, + 220, + 2972, + 2014, + 53983 + ], + "response": "To find the answer, let's break down the request based on the provided text:\n\n1. **Analyze", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-003", + "task": "latest", + "gold": 78, + "arms": { + "native": { + "tokens": [ + 23, + 19, + 248046 + ], + "response": "84<|im_end|>", + "stop": "eos", + "answer": 84, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 248044 + ], + "response": "2<|endoftext|>", + "stop": "eos", + "answer": 2, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1353, + 506, + 279, + 795, + 3766, + 303, + 279, + 9640, + 13, + 561, + 1156, + 369, + 9859, + 364, + 279, + 328, + 4119 + ], + "response": "To find the answer, let's look at the data provided in the prompt. The user is asking for the \"last", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-004", + "task": "latest", + "gold": 44, + "arms": { + "native": { + "tokens": [ + 19, + 19, + 248046 + ], + "response": "44<|im_end|>", + "stop": "eos", + "answer": 44, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17 + ], + "response": "222222222222222222222222", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1622, + 3018, + 383, + 279, + 3766, + 1414, + 25, + 271, + 16, + 13, + 220, + 2972, + 2014, + 53983 + ], + "response": "To find the answer, let's break down the request based on the provided text:\n\n1. **Analyze", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-005", + "task": "latest", + "gold": 37, + "arms": { + "native": { + "tokens": [ + 18, + 22, + 248046 + ], + "response": "37<|im_end|>", + "stop": "eos", + "answer": 37, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1353, + 506, + 279, + 795, + 3766, + 303, + 279, + 9640, + 13, + 561, + 1156, + 369, + 9859, + 364, + 279, + 328, + 4119 + ], + "response": "To find the answer, let's look at the data provided in the prompt. The user is asking for the \"last", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-006", + "task": "latest", + "gold": 78, + "arms": { + "native": { + "tokens": [ + 22, + 23, + 248046 + ], + "response": "78<|im_end|>", + "stop": "eos", + "answer": 78, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1622, + 3018, + 383, + 279, + 3766, + 1414, + 13, + 271, + 16, + 13, + 220, + 2972, + 2014, + 53983 + ], + "response": "To find the answer, let's break down the request based on the provided text.\n\n1. **Analyze", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-latest-007", + "task": "latest", + "gold": 64, + "arms": { + "native": { + "tokens": [ + 21, + 19, + 248046 + ], + "response": "64<|im_end|>", + "stop": "eos", + "answer": 64, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 19, + 248044 + ], + "response": "24<|endoftext|>", + "stop": "eos", + "answer": 24, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17 + ], + "response": "222222222222222222222222", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 4087, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1622, + 3018, + 383, + 279, + 3766, + 1414, + 13, + 271, + 16, + 13, + 220, + 2972, + 2014, + 53983 + ], + "response": "To find the answer, let's break down the request based on the provided text.\n\n1. **Analyze", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-000", + "task": "addition", + "gold": 83, + "arms": { + "native": { + "tokens": [ + 23, + 18, + 248046 + ], + "response": "83<|im_end|>", + "stop": "eos", + "answer": 83, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 18, + 248044 + ], + "response": "23<|endoftext|>", + "stop": "eos", + "answer": 23, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 22, + 248044 + ], + "response": "27<|endoftext|>", + "stop": "eos", + "answer": 27, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 17, + 15, + 321, + 220, + 21, + 18, + 11, + 567, + 4777, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 17 + ], + "response": "To find the sum of 20 and 63, we simply add the two numbers together:\n\n$$2", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-001", + "task": "addition", + "gold": 115, + "arms": { + "native": { + "tokens": [ + 16, + 16, + 20, + 248046 + ], + "response": "115<|im_end|>", + "stop": "eos", + "answer": 115, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 20, + 20, + 248044 + ], + "response": "155<|endoftext|>", + "stop": "eos", + "answer": 155, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 19, + 18, + 321, + 220, + 22, + 17, + 11, + 567, + 628, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 19 + ], + "response": "To find the sum of 43 and 72, we can add the two numbers together:\n\n$$4", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-002", + "task": "addition", + "gold": 149, + "arms": { + "native": { + "tokens": [ + 16, + 19, + 24, + 248046 + ], + "response": "149<|im_end|>", + "stop": "eos", + "answer": 149, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 18, + 24, + 248044 + ], + "response": "139<|endoftext|>", + "stop": "eos", + "answer": 139, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "111111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 21, + 18, + 321, + 220, + 23, + 21, + 11, + 567, + 628, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 198 + ], + "response": "To find the sum of 63 and 86, we can add the two numbers together:\n\n$$\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-003", + "task": "addition", + "gold": 65, + "arms": { + "native": { + "tokens": [ + 22, + 15, + 248046 + ], + "response": "70<|im_end|>", + "stop": "eos", + "answer": 70, + "correct": false + }, + "direct_3": { + "tokens": [ + 18, + 20, + 248044 + ], + "response": "35<|endoftext|>", + "stop": "eos", + "answer": 35, + "correct": false + }, + "direct_4": { + "tokens": [ + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18, + 18 + ], + "response": "333333333333333333333333", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 18, + 15, + 321, + 220, + 20, + 15, + 11, + 567, + 4777, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 18 + ], + "response": "To find the sum of 30 and 50, we simply add the two numbers together:\n\n$$3", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-004", + "task": "addition", + "gold": 108, + "arms": { + "native": { + "tokens": [ + 16, + 15, + 23, + 248046 + ], + "response": "108<|im_end|>", + "stop": "eos", + "answer": 108, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 20, + 15, + 248044 + ], + "response": "150<|endoftext|>", + "stop": "eos", + "answer": 150, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20, + 20 + ], + "response": "105555555555555555555555", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 20, + 18, + 321, + 220, + 20, + 20, + 11, + 567, + 628, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 20 + ], + "response": "To find the sum of 53 and 55, we can add the two numbers together:\n\n$$5", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-005", + "task": "addition", + "gold": 102, + "arms": { + "native": { + "tokens": [ + 16, + 15, + 17, + 248046 + ], + "response": "102<|im_end|>", + "stop": "eos", + "answer": 102, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 19, + 15, + 248044 + ], + "response": "140<|endoftext|>", + "stop": "eos", + "answer": 140, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17, + 17 + ], + "response": "222222222222222222222222", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 19, + 17, + 321, + 220, + 21, + 15, + 11, + 567, + 4777, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 19 + ], + "response": "To find the sum of 42 and 60, we simply add the two numbers together:\n\n$$4", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-006", + "task": "addition", + "gold": 100, + "arms": { + "native": { + "tokens": [ + 16, + 15, + 15, + 248046 + ], + "response": "100<|im_end|>", + "stop": "eos", + "answer": 100, + "correct": true + }, + "direct_3": { + "tokens": [ + 17, + 16, + 24, + 248044 + ], + "response": "219<|endoftext|>", + "stop": "eos", + "answer": 219, + "correct": false + }, + "direct_4": { + "tokens": [ + 17, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22, + 22 + ], + "response": "277777777777777777777777", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 17, + 16, + 321, + 220, + 22, + 24, + 11, + 567, + 628, + 884, + 279, + 5981, + 321, + 279, + 21330, + 3658, + 25, + 271 + ], + "response": "To find the sum of 21 and 79, we can add the ones and the tens together:\n\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-addition-007", + "task": "addition", + "gold": 114, + "arms": { + "native": { + "tokens": [ + 16, + 16, + 19, + 248046 + ], + "response": "114<|im_end|>", + "stop": "eos", + "answer": 114, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 18, + 19, + 248044 + ], + "response": "134<|endoftext|>", + "stop": "eos", + "answer": 134, + "correct": false + }, + "direct_4": { + "tokens": [ + 18, + 15, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16 + ], + "response": "301111111111111111111111", + "stop": "max_new_tokens", + "answer": null, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 2542, + 314, + 220, + 18, + 16, + 321, + 220, + 23, + 18, + 11, + 567, + 628, + 884, + 279, + 1330, + 4947, + 3658, + 25, + 271, + 13682, + 18 + ], + "response": "To find the sum of 31 and 83, we can add the two numbers together:\n\n$$3", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-000", + "task": "count", + "gold": 14, + "arms": { + "native": { + "tokens": [ + 16, + 15, + 248046 + ], + "response": "10<|im_end|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 1698, + 314, + 279, + 5024, + 1455, + 11, + 353, + 668, + 1698, + 279, + 54133, + 314, + 279, + 3299, + 328, + 69, + 738, + 1, + 303, + 279, + 3766 + ], + "response": "To find the count of the specified item, I will count the occurrences of the word \"fence\" in the provided", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-001", + "task": "count", + "gold": 13, + "arms": { + "native": { + "tokens": [ + 16, + 20, + 248046 + ], + "response": "15<|im_end|>", + "stop": "eos", + "answer": 15, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 7995, + 279, + 1698, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1879, + 886, + 3018, + 383, + 279, + 3766, + 3010, + 13, + 271, + 760, + 1156, + 579, + 1879, + 369 + ], + "response": "To determine the count, let's break down the input string based on the provided example.\n\nThe user's input is", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-002", + "task": "count", + "gold": 15, + "arms": { + "native": { + "tokens": [ + 16, + 20, + 248046 + ], + "response": "15<|im_end|>", + "stop": "eos", + "answer": 15, + "correct": true + }, + "direct_3": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 1698, + 314, + 279, + 1455, + 328, + 300, + 977, + 1, + 318, + 7949, + 369, + 264, + 82170, + 364, + 328, + 1767, + 3842, + 1042, + 579, + 1698, + 279 + ], + "response": "To find the count of the item \"elms\" (which is a typo for \"count\"), let's count the", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-003", + "task": "count", + "gold": 12, + "arms": { + "native": { + "tokens": [ + 16, + 18, + 248046 + ], + "response": "13<|im_end|>", + "stop": "eos", + "answer": 13, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 1698, + 314, + 279, + 1455, + 328, + 67, + 2792, + 487, + 1042, + 579, + 22903, + 279, + 1879, + 886, + 25, + 328, + 67, + 2792, + 11, + 293, + 2792 + ], + "response": "To find the count of the item \"dune\", let's analyze the input string: \"dune, dune", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-004", + "task": "count", + "gold": 15, + "arms": { + "native": { + "tokens": [ + 16, + 18, + 248046 + ], + "response": "13<|im_end|>", + "stop": "eos", + "answer": 13, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 1423, + 279, + 1698, + 314, + 279, + 5024, + 1455, + 11, + 353, + 668, + 1698, + 279, + 54133, + 314, + 279, + 3299, + 328, + 67, + 2792, + 1, + 303, + 279, + 3766 + ], + "response": "To find the count of the specified item, I will count the occurrences of the word \"dune\" in the provided", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-005", + "task": "count", + "gold": 13, + "arms": { + "native": { + "tokens": [ + 16, + 20, + 248046 + ], + "response": "15<|im_end|>", + "stop": "eos", + "answer": 15, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 11290, + 411, + 11, + 1042, + 579, + 1698, + 279, + 54133, + 314, + 279, + 3299, + 328, + 2117, + 273, + 1, + 303, + 279, + 3766, + 1414, + 13, + 271, + 760, + 1156 + ], + "response": "To solve this, let's count the occurrences of the word \"maple\" in the provided text.\n\nThe user", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-006", + "task": "count", + "gold": 13, + "arms": { + "native": { + "tokens": [ + 16, + 15, + 248046 + ], + "response": "10<|im_end|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "direct_4": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 11290, + 411, + 11, + 1042, + 579, + 1698, + 279, + 54133, + 314, + 279, + 3299, + 328, + 2117, + 273, + 1, + 303, + 279, + 3766, + 1414, + 13, + 271, + 760, + 16629 + ], + "response": "To solve this, let's count the occurrences of the word \"maple\" in the provided text.\n\nThe phrase", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + }, + { + "id": "screen-count-007", + "task": "count", + "gold": 10, + "arms": { + "native": { + "tokens": [ + 16, + 20, + 248046 + ], + "response": "15<|im_end|>", + "stop": "eos", + "answer": 15, + "correct": false + }, + "direct_3": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": true + }, + "direct_4": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "direct_5": { + "tokens": [ + 1206, + 7995, + 279, + 1698, + 11, + 1042, + 579, + 1387, + 1441, + 279, + 1879, + 886, + 3018, + 383, + 279, + 3766, + 3010, + 13, + 271, + 332, + 2425, + 2791, + 64700, + 198 + ], + "response": "To determine the count, let's break down the input string based on the provided example.\n\n**Input Data:**\n", + "stop": "max_new_tokens", + "answer": null, + "correct": false + } + } + } +] diff --git a/results/lisa-full-answer-reproduction/screen-summary.json b/results/lisa-full-answer-reproduction/screen-summary.json new file mode 100644 index 0000000..9758a73 --- /dev/null +++ b/results/lisa-full-answer-reproduction/screen-summary.json @@ -0,0 +1,145 @@ +{ + "lookup": { + "native": { + "n": 8, + "correct": 8, + "unscored": 0, + "native_correct_to_wrong_integer": [] + }, + "direct_3": { + "n": 8, + "correct": 0, + "unscored": 0, + "native_correct_to_wrong_integer": [ + "screen-lookup-000", + "screen-lookup-001", + "screen-lookup-002", + "screen-lookup-003", + "screen-lookup-004", + "screen-lookup-005", + "screen-lookup-006", + "screen-lookup-007" + ] + }, + "direct_4": { + "n": 8, + "correct": 0, + "unscored": 4, + "native_correct_to_wrong_integer": [ + "screen-lookup-001", + "screen-lookup-003", + "screen-lookup-004", + "screen-lookup-005" + ] + }, + "direct_5": { + "n": 8, + "correct": 0, + "unscored": 8, + "native_correct_to_wrong_integer": [] + } + }, + "latest": { + "native": { + "n": 8, + "correct": 6, + "unscored": 0, + "native_correct_to_wrong_integer": [] + }, + "direct_3": { + "n": 8, + "correct": 0, + "unscored": 0, + "native_correct_to_wrong_integer": [ + "screen-latest-000", + "screen-latest-001", + "screen-latest-004", + "screen-latest-005", + "screen-latest-006", + "screen-latest-007" + ] + }, + "direct_4": { + "n": 8, + "correct": 0, + "unscored": 4, + "native_correct_to_wrong_integer": [ + "screen-latest-000", + "screen-latest-001", + "screen-latest-005" + ] + }, + "direct_5": { + "n": 8, + "correct": 0, + "unscored": 8, + "native_correct_to_wrong_integer": [] + } + }, + "addition": { + "native": { + "n": 8, + "correct": 7, + "unscored": 0, + "native_correct_to_wrong_integer": [] + }, + "direct_3": { + "n": 8, + "correct": 0, + "unscored": 0, + "native_correct_to_wrong_integer": [ + "screen-addition-000", + "screen-addition-001", + "screen-addition-002", + "screen-addition-004", + "screen-addition-005", + "screen-addition-006", + "screen-addition-007" + ] + }, + "direct_4": { + "n": 8, + "correct": 0, + "unscored": 7, + "native_correct_to_wrong_integer": [ + "screen-addition-000" + ] + }, + "direct_5": { + "n": 8, + "correct": 0, + "unscored": 8, + "native_correct_to_wrong_integer": [] + } + }, + "count": { + "native": { + "n": 8, + "correct": 1, + "unscored": 0, + "native_correct_to_wrong_integer": [] + }, + "direct_3": { + "n": 8, + "correct": 1, + "unscored": 0, + "native_correct_to_wrong_integer": [ + "screen-count-002" + ] + }, + "direct_4": { + "n": 8, + "correct": 0, + "unscored": 0, + "native_correct_to_wrong_integer": [ + "screen-count-002" + ] + }, + "direct_5": { + "n": 8, + "correct": 0, + "unscored": 8, + "native_correct_to_wrong_integer": [] + } + } +} diff --git a/results/lisa-full-answer-reproduction/selection.json b/results/lisa-full-answer-reproduction/selection.json new file mode 100644 index 0000000..e930e90 --- /dev/null +++ b/results/lisa-full-answer-reproduction/selection.json @@ -0,0 +1,13 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "screen_sha256": "59225fa1b583af3a5890c020b9cc18487d182312728865e4386fa9007fee0da4", + "chosen": { + "task": "lookup", + "arm": "direct_3", + "recipients": [ + 15, + 19, + 23 + ] + } +} diff --git a/results/lisa-full-answer-reproduction/train-spec.json b/results/lisa-full-answer-reproduction/train-spec.json new file mode 100644 index 0000000..1f3b5f9 --- /dev/null +++ b/results/lisa-full-answer-reproduction/train-spec.json @@ -0,0 +1,19 @@ +{ + "screen": { + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "screen_sha256": "59225fa1b583af3a5890c020b9cc18487d182312728865e4386fa9007fee0da4", + "chosen": { + "task": "lookup", + "arm": "direct_3", + "recipients": [ + 15, + 19, + 23 + ] + } + }, + "epochs": 2, + "rank": 40, + "seed": 621011, + "objective": "0.25 teacher attention Huber + 0.75 full-vocabulary completion CE" +} diff --git a/results/lisa-full-answer-reproduction/verified-screen.json b/results/lisa-full-answer-reproduction/verified-screen.json new file mode 100644 index 0000000..7211dbe --- /dev/null +++ b/results/lisa-full-answer-reproduction/verified-screen.json @@ -0,0 +1,5 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "rows_sha256": "59225fa1b583af3a5890c020b9cc18487d182312728865e4386fa9007fee0da4", + "rows_verified": 32 +} From 4e66b5d5baaf83f36cecaf9a019dd3bd5eaf1de7 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Wed, 25 Nov 2026 05:00:09 +0800 Subject: [PATCH 6/7] Archive LiSA fit capture verification --- docs/LISA_FULL_ANSWER_RESULTS.md | 2 +- .../verified-fit-capture.json | 181 ++++++++++++++++++ 2 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 results/lisa-full-answer-reproduction/verified-fit-capture.json diff --git a/docs/LISA_FULL_ANSWER_RESULTS.md b/docs/LISA_FULL_ANSWER_RESULTS.md index 0747b2e..6adade6 100644 --- a/docs/LISA_FULL_ANSWER_RESULTS.md +++ b/docs/LISA_FULL_ANSWER_RESULTS.md @@ -19,4 +19,4 @@ ## 训练与独立留出评估 -已启动三个接收层的 LiSA 训练流程。使用 24 道冻结拟合题和 8 道验证题,训练两轮,随后评估 32 道独立留出题。完整答案恢复率和配对区间待测试结束。 +三个接收层各训练 825,344 个参数,总计 2,476,032 个。完成了 24 道冻结拟合题的教师分数采集,复核按题检查输入 token、教师张量形状与有限值,并保存各采集文件的 SHA-256。训练跑两轮,用 8 道验证题选择检查点,随后评估 32 道独立留出题。完整答案恢复率和配对区间待测试结束。 diff --git a/results/lisa-full-answer-reproduction/verified-fit-capture.json b/results/lisa-full-answer-reproduction/verified-fit-capture.json new file mode 100644 index 0000000..cffc38a --- /dev/null +++ b/results/lisa-full-answer-reproduction/verified-fit-capture.json @@ -0,0 +1,181 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "train_spec_sha256": "df49b966e0f68bcb0f06642e9ec141008aaf8550d63fc467f00c6b9e864af799", + "task": "lookup", + "recipients": [ + 15, + 19, + 23 + ], + "captures_verified": 24, + "records": [ + { + "id": "fit-lookup-000", + "file": "000.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "e7489bf56a40293759ac2e24822cbf3cd5fbd88a3d2429f069009e9197de2c46" + }, + { + "id": "fit-lookup-001", + "file": "001.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "27e531a27d9ad9f04675f4df1ffd66b4ec89089e23d11b9b0de6285a4a729af3" + }, + { + "id": "fit-lookup-002", + "file": "002.npz", + "input_tokens": 100, + "answer_and_eos_tokens": 3, + "sha256": "45a01a55c646e0ea3635b5794072b5371984f7fa9aca1b1c827155579a06fb9d" + }, + { + "id": "fit-lookup-003", + "file": "003.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "38792661d7a9372a32609a52f64724b2553bc12311b56b482324ddb52165f97d" + }, + { + "id": "fit-lookup-004", + "file": "004.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "c9a628e3d17ff06d276dabf26008fbb139f53ecbc814c0cd497c9be80c2e6bd3" + }, + { + "id": "fit-lookup-005", + "file": "005.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "d1c0b5b50dbdba10488fb655d7414bc309647ae6f79a1835f7e91a6594859845" + }, + { + "id": "fit-lookup-006", + "file": "006.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "744daf42b3431fdb56de9710ddbf5f3e322ed99181742643dd5c053af9ae6a11" + }, + { + "id": "fit-lookup-007", + "file": "007.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "4b2f194edddc6da7fd79676db47580e31e3345d753b4e5b961c3bd539f29e582" + }, + { + "id": "fit-lookup-008", + "file": "008.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "b839bc0393ba2ddd4fa8f0d15cbbfac319585a336e26c3ce1cb3a3e0708769df" + }, + { + "id": "fit-lookup-009", + "file": "009.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "e24b25781451ba931dcc1b2319cf40b946456cfaaafc15100351f9aff1c23846" + }, + { + "id": "fit-lookup-010", + "file": "010.npz", + "input_tokens": 104, + "answer_and_eos_tokens": 3, + "sha256": "5576e4a26f4d255b39683e503cf4c868c582d668639255d034a82b91f723b9d3" + }, + { + "id": "fit-lookup-011", + "file": "011.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "b659078ce11cc5e175a3987e14353b95fd837f13ea6b3aad54cfb5ebc6ff3d8f" + }, + { + "id": "fit-lookup-012", + "file": "012.npz", + "input_tokens": 104, + "answer_and_eos_tokens": 3, + "sha256": "adb5d0128a5146cd6662c7f2fdb8dc9404032bb17cbe8eea2a6387a8d0054a9d" + }, + { + "id": "fit-lookup-013", + "file": "013.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "7e704a18185ef9b0e7c4f001444841c9a0aa40bfaf392fa549ec69f8b7e7c288" + }, + { + "id": "fit-lookup-014", + "file": "014.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "4033dbdaa677b4eb49f7aab020a8f1329da8753326bd11e07be64471ea39559a" + }, + { + "id": "fit-lookup-015", + "file": "015.npz", + "input_tokens": 101, + "answer_and_eos_tokens": 3, + "sha256": "6fd9fc00fdbb0dfb4c3fd385c411c9e09931c3bd30d7406881d61bd00150f891" + }, + { + "id": "fit-lookup-016", + "file": "016.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "be79c79a87ed2c3ced2c9fa4efacb7d373d521dd301fad48d0ce7d0b714f60ba" + }, + { + "id": "fit-lookup-017", + "file": "017.npz", + "input_tokens": 101, + "answer_and_eos_tokens": 3, + "sha256": "f2e2ac748ac1c136e18725be7e4d31b8501ada2c2f2f46a0a5ca399b087ca572" + }, + { + "id": "fit-lookup-018", + "file": "018.npz", + "input_tokens": 105, + "answer_and_eos_tokens": 3, + "sha256": "5befccbda4c55e06b2b8cdd7dd040dcbe7cb3dc8d3d09ad55542f03820e066ad" + }, + { + "id": "fit-lookup-019", + "file": "019.npz", + "input_tokens": 100, + "answer_and_eos_tokens": 3, + "sha256": "3037fea3ed609eb068ebcc85bf58fc56288df201e21e0988339710a981734e87" + }, + { + "id": "fit-lookup-020", + "file": "020.npz", + "input_tokens": 103, + "answer_and_eos_tokens": 3, + "sha256": "93e7764c575f8d3b9a2a4619d4458bf732fb20240e5c9a6261700d6bae59bc29" + }, + { + "id": "fit-lookup-021", + "file": "021.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "f79679202390c4bf2d41db5e12a00867c4d77f2f5b912006cdf43200b93dcc3c" + }, + { + "id": "fit-lookup-022", + "file": "022.npz", + "input_tokens": 100, + "answer_and_eos_tokens": 3, + "sha256": "c66571c5ad7cc0328eec7c170392c0ed027151b46097030e87dab9c44d488cf0" + }, + { + "id": "fit-lookup-023", + "file": "023.npz", + "input_tokens": 102, + "answer_and_eos_tokens": 3, + "sha256": "3f971f14a8cbfde8644b4e82f4ce8c4b10d3df0314ea15ae5141a50d957c53ff" + } + ] +} From 6aa66b29a18ef0f6bbb6b07f2e332785f3fc496f Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Wed, 25 Nov 2026 11:11:13 +0800 Subject: [PATCH 7/7] Archive verified LiSA full-answer recovery results --- docs/LISA_FULL_ANSWER_RESULTS.md | 26 +- .../result.sha256 | 6 + .../test-audit.json | 63 + .../test-items.json | 1282 +++++++++++++++++ .../lisa-full-answer-reproduction/trace.json | 547 +++++++ .../verified-test.json | 68 + 6 files changed, 1991 insertions(+), 1 deletion(-) create mode 100644 results/lisa-full-answer-reproduction/result.sha256 create mode 100644 results/lisa-full-answer-reproduction/test-audit.json create mode 100644 results/lisa-full-answer-reproduction/test-items.json create mode 100644 results/lisa-full-answer-reproduction/trace.json create mode 100644 results/lisa-full-answer-reproduction/verified-test.json diff --git a/docs/LISA_FULL_ANSWER_RESULTS.md b/docs/LISA_FULL_ANSWER_RESULTS.md index 6adade6..4076fb0 100644 --- a/docs/LISA_FULL_ANSWER_RESULTS.md +++ b/docs/LISA_FULL_ANSWER_RESULTS.md @@ -19,4 +19,28 @@ ## 训练与独立留出评估 -三个接收层各训练 825,344 个参数,总计 2,476,032 个。完成了 24 道冻结拟合题的教师分数采集,复核按题检查输入 token、教师张量形状与有限值,并保存各采集文件的 SHA-256。训练跑两轮,用 8 道验证题选择检查点,随后评估 32 道独立留出题。完整答案恢复率和配对区间待测试结束。 +三个接收层各训练 825,344 个参数,总计 2,476,032 个。完成了 24 道冻结拟合题的教师分数采集,复核按题检查输入 token、教师张量形状与有限值,并保存各采集文件的 SHA-256。 + +两轮各完成 24 次更新。用冻结分词器重新解码两轮各 8 道验证题的生成结果,首轮答对 1 道,第二轮答对 2 道。按预先固定的验证正确数选用第二轮检查点。两轮逐步损失、验证题原始输出及检查点选择见训练记录。 [训练记录](../results/lisa-full-answer-reproduction/trace.json) + +### 留出集结果 + +在 32 道独立查表题上,三组共 96 条回答全部生成了正常的结束 token,并能提取完整整数。原模型全对。三层直接共享让 32 道题都答成了错误整数,LiSA 救回其中 3 道,另外 29 道仍答错。 + +| 配置 | 正确数 | 准确率 | +| --- | ---: | ---: | +| 原模型 | 32/32 | 100% | +| 三层直接共享 | 0/32 | 0% | +| 三层 LiSA | 3/32 | 9.38% | + +| 恢复题 | 原模型及标准答案 | 直接共享 | LiSA | +| --- | ---: | ---: | ---: | +| `test-lookup-014` | 71 | 47 | 71 | +| `test-lookup-020` | 94 | 5 | 94 | +| `test-lookup-021` | 44 | 10 | 44 | + +相对直接共享,LiSA 准确率提高 9.38 个百分点,按题配对 bootstrap 95% 区间为 0 至 21.88 个百分点。McNemar 精确双侧检验的 p 值为 0.25。逐题变化方向是 3 道从错变对、0 道从对变错。直接共享全错,因此这个留出集无法估计 LiSA 保留直接共享已有正确答案的能力。 + +结果确认了三个真实数值错误的恢复案例。样本上的准确率提升仍有较大不确定性。结论限于这一个 Qwen3.5-2B 检查点、查表任务和三个接收层,训练用 24 道合成题。四层和五层共享只做了开发筛选,其 LiSA 恢复效果仍待测。 + +远程实验和独立复核均以退出码 0 完成。复核从保存的 token 重新解析并重算三组分数,结果与训练进程生成的汇总一致。摘要记录的是远程原件路径,选中的适配器保存在该远程运行目录。 [逐题输出](../results/lisa-full-answer-reproduction/test-items.json) · [配对统计](../results/lisa-full-answer-reproduction/test-audit.json) · [复核回执](../results/lisa-full-answer-reproduction/verified-test.json) · [文件摘要](../results/lisa-full-answer-reproduction/result.sha256) diff --git a/results/lisa-full-answer-reproduction/result.sha256 b/results/lisa-full-answer-reproduction/result.sha256 new file mode 100644 index 0000000..c91f781 --- /dev/null +++ b/results/lisa-full-answer-reproduction/result.sha256 @@ -0,0 +1,6 @@ +df49b966e0f68bcb0f06642e9ec141008aaf8550d63fc467f00c6b9e864af799 /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/train-spec.json +3366a4f4653837e4698ebabaa1d9656788b920f04f3b4e01f776342347c3604d /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/trace.json +c82db5af7fa42cf58a349f3e53961da2360b211a7ed606f53a728860c64f6f29 /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/lisa.pt +5c04ffff27c8b31a0be2d39553ed035d3c677907cabc1d17a9ea5886f97f8e5d /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/test-items.json +c5f8b769819335d4a0969575f33c783859b4114dbf13405feeb06f3610a593c8 /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/test-audit.json +74c5b1a4a4a88420d3965e57671d765f22cc3440eb74e9737d0ecbb7b0776ad1 /opt/exp-model-parameter-similarity/runs/lisa-full-answer-20261124-run/final/verified-test.json diff --git a/results/lisa-full-answer-reproduction/test-audit.json b/results/lisa-full-answer-reproduction/test-audit.json new file mode 100644 index 0000000..6fe4d2d --- /dev/null +++ b/results/lisa-full-answer-reproduction/test-audit.json @@ -0,0 +1,63 @@ +{ + "n": 32, + "correct": { + "native": 32, + "direct": 0, + "lisa": 3 + }, + "substantive_loss_ids": [ + "test-lookup-000", + "test-lookup-001", + "test-lookup-002", + "test-lookup-003", + "test-lookup-004", + "test-lookup-005", + "test-lookup-006", + "test-lookup-007", + "test-lookup-008", + "test-lookup-009", + "test-lookup-010", + "test-lookup-011", + "test-lookup-012", + "test-lookup-013", + "test-lookup-014", + "test-lookup-015", + "test-lookup-016", + "test-lookup-017", + "test-lookup-018", + "test-lookup-019", + "test-lookup-020", + "test-lookup-021", + "test-lookup-022", + "test-lookup-023", + "test-lookup-024", + "test-lookup-025", + "test-lookup-026", + "test-lookup-027", + "test-lookup-028", + "test-lookup-029", + "test-lookup-030", + "test-lookup-031" + ], + "substantive_rescued_ids": [ + "test-lookup-014", + "test-lookup-020", + "test-lookup-021" + ], + "unscored": { + "native": 0, + "direct": 0, + "lisa": 0 + }, + "native_correct_lost_by_direct": 32, + "rescued": 3, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 3, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.09375, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.21875 + ], + "mcnemar_exact_p": 0.25 +} diff --git a/results/lisa-full-answer-reproduction/test-items.json b/results/lisa-full-answer-reproduction/test-items.json new file mode 100644 index 0000000..9fb1f87 --- /dev/null +++ b/results/lisa-full-answer-reproduction/test-items.json @@ -0,0 +1,1282 @@ +[ + { + "id": "test-lookup-000", + "task": "lookup", + "gold": 79, + "arms": { + "native": { + "tokens": [ + 22, + 24, + 248046 + ], + "response": "79<|im_end|>", + "stop": "eos", + "answer": 79, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 24, + 248044 + ], + "response": "29<|endoftext|>", + "stop": "eos", + "answer": 29, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 17, + 248046 + ], + "response": "92<|im_end|>", + "stop": "eos", + "answer": 92, + "correct": false + } + } + }, + { + "id": "test-lookup-001", + "task": "lookup", + "gold": 70, + "arms": { + "native": { + "tokens": [ + 22, + 15, + 248046 + ], + "response": "70<|im_end|>", + "stop": "eos", + "answer": 70, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 22, + 248044 + ], + "response": "27<|endoftext|>", + "stop": "eos", + "answer": 27, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 24, + 248046 + ], + "response": "99<|im_end|>", + "stop": "eos", + "answer": 99, + "correct": false + } + } + }, + { + "id": "test-lookup-002", + "task": "lookup", + "gold": 92, + "arms": { + "native": { + "tokens": [ + 24, + 17, + 248046 + ], + "response": "92<|im_end|>", + "stop": "eos", + "answer": 92, + "correct": true + }, + "direct": { + "tokens": [ + 20, + 23, + 248044 + ], + "response": "58<|endoftext|>", + "stop": "eos", + "answer": 58, + "correct": false + }, + "lisa": { + "tokens": [ + 23, + 20, + 248046 + ], + "response": "85<|im_end|>", + "stop": "eos", + "answer": 85, + "correct": false + } + } + }, + { + "id": "test-lookup-003", + "task": "lookup", + "gold": 68, + "arms": { + "native": { + "tokens": [ + 21, + 23, + 248046 + ], + "response": "68<|im_end|>", + "stop": "eos", + "answer": 68, + "correct": true + }, + "direct": { + "tokens": [ + 19, + 24, + 248044 + ], + "response": "49<|endoftext|>", + "stop": "eos", + "answer": 49, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": false + } + } + }, + { + "id": "test-lookup-004", + "task": "lookup", + "gold": 58, + "arms": { + "native": { + "tokens": [ + 20, + 23, + 248046 + ], + "response": "58<|im_end|>", + "stop": "eos", + "answer": 58, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 21, + 20, + 248046 + ], + "response": "65<|im_end|>", + "stop": "eos", + "answer": 65, + "correct": false + } + } + }, + { + "id": "test-lookup-005", + "task": "lookup", + "gold": 64, + "arms": { + "native": { + "tokens": [ + 21, + 19, + 248046 + ], + "response": "64<|im_end|>", + "stop": "eos", + "answer": 64, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "lisa": { + "tokens": [ + 23, + 19, + 248046 + ], + "response": "84<|im_end|>", + "stop": "eos", + "answer": 84, + "correct": false + } + } + }, + { + "id": "test-lookup-006", + "task": "lookup", + "gold": 50, + "arms": { + "native": { + "tokens": [ + 20, + 15, + 248046 + ], + "response": "50<|im_end|>", + "stop": "eos", + "answer": 50, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 21, + 248044 + ], + "response": "26<|endoftext|>", + "stop": "eos", + "answer": 26, + "correct": false + }, + "lisa": { + "tokens": [ + 21, + 19, + 248046 + ], + "response": "64<|im_end|>", + "stop": "eos", + "answer": 64, + "correct": false + } + } + }, + { + "id": "test-lookup-007", + "task": "lookup", + "gold": 38, + "arms": { + "native": { + "tokens": [ + 18, + 23, + 248046 + ], + "response": "38<|im_end|>", + "stop": "eos", + "answer": 38, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 16, + 248046 + ], + "response": "91<|im_end|>", + "stop": "eos", + "answer": 91, + "correct": false + } + } + }, + { + "id": "test-lookup-008", + "task": "lookup", + "gold": 31, + "arms": { + "native": { + "tokens": [ + 18, + 16, + 248046 + ], + "response": "31<|im_end|>", + "stop": "eos", + "answer": 31, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 16, + 248046 + ], + "response": "91<|im_end|>", + "stop": "eos", + "answer": 91, + "correct": false + } + } + }, + { + "id": "test-lookup-009", + "task": "lookup", + "gold": 24, + "arms": { + "native": { + "tokens": [ + 17, + 19, + 248046 + ], + "response": "24<|im_end|>", + "stop": "eos", + "answer": 24, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 24, + 248044 + ], + "response": "29<|endoftext|>", + "stop": "eos", + "answer": 29, + "correct": false + }, + "lisa": { + "tokens": [ + 21, + 16, + 248046 + ], + "response": "61<|im_end|>", + "stop": "eos", + "answer": 61, + "correct": false + } + } + }, + { + "id": "test-lookup-010", + "task": "lookup", + "gold": 69, + "arms": { + "native": { + "tokens": [ + 21, + 24, + 248046 + ], + "response": "69<|im_end|>", + "stop": "eos", + "answer": 69, + "correct": true + }, + "direct": { + "tokens": [ + 19, + 248044 + ], + "response": "4<|endoftext|>", + "stop": "eos", + "answer": 4, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": false + } + } + }, + { + "id": "test-lookup-011", + "task": "lookup", + "gold": 92, + "arms": { + "native": { + "tokens": [ + 24, + 17, + 248046 + ], + "response": "92<|im_end|>", + "stop": "eos", + "answer": 92, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 20, + 17, + 248046 + ], + "response": "52<|im_end|>", + "stop": "eos", + "answer": 52, + "correct": false + } + } + }, + { + "id": "test-lookup-012", + "task": "lookup", + "gold": 98, + "arms": { + "native": { + "tokens": [ + 24, + 23, + 248046 + ], + "response": "98<|im_end|>", + "stop": "eos", + "answer": 98, + "correct": true + }, + "direct": { + "tokens": [ + 21, + 20, + 248044 + ], + "response": "65<|endoftext|>", + "stop": "eos", + "answer": 65, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 17, + 248046 + ], + "response": "92<|im_end|>", + "stop": "eos", + "answer": 92, + "correct": false + } + } + }, + { + "id": "test-lookup-013", + "task": "lookup", + "gold": 27, + "arms": { + "native": { + "tokens": [ + 17, + 22, + 248046 + ], + "response": "27<|im_end|>", + "stop": "eos", + "answer": 27, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 24, + 248046 + ], + "response": "99<|im_end|>", + "stop": "eos", + "answer": 99, + "correct": false + } + } + }, + { + "id": "test-lookup-014", + "task": "lookup", + "gold": 71, + "arms": { + "native": { + "tokens": [ + 22, + 16, + 248046 + ], + "response": "71<|im_end|>", + "stop": "eos", + "answer": 71, + "correct": true + }, + "direct": { + "tokens": [ + 19, + 22, + 248044 + ], + "response": "47<|endoftext|>", + "stop": "eos", + "answer": 47, + "correct": false + }, + "lisa": { + "tokens": [ + 22, + 16, + 248046 + ], + "response": "71<|im_end|>", + "stop": "eos", + "answer": 71, + "correct": true + } + } + }, + { + "id": "test-lookup-015", + "task": "lookup", + "gold": 88, + "arms": { + "native": { + "tokens": [ + 23, + 23, + 248046 + ], + "response": "88<|im_end|>", + "stop": "eos", + "answer": 88, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 16, + 248044 + ], + "response": "21<|endoftext|>", + "stop": "eos", + "answer": 21, + "correct": false + }, + "lisa": { + "tokens": [ + 18, + 24, + 248046 + ], + "response": "39<|im_end|>", + "stop": "eos", + "answer": 39, + "correct": false + } + } + }, + { + "id": "test-lookup-016", + "task": "lookup", + "gold": 81, + "arms": { + "native": { + "tokens": [ + 23, + 16, + 248046 + ], + "response": "81<|im_end|>", + "stop": "eos", + "answer": 81, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 19, + 248044 + ], + "response": "14<|endoftext|>", + "stop": "eos", + "answer": 14, + "correct": false + }, + "lisa": { + "tokens": [ + 23, + 19, + 248046 + ], + "response": "84<|im_end|>", + "stop": "eos", + "answer": 84, + "correct": false + } + } + }, + { + "id": "test-lookup-017", + "task": "lookup", + "gold": 93, + "arms": { + "native": { + "tokens": [ + 24, + 18, + 248046 + ], + "response": "93<|im_end|>", + "stop": "eos", + "answer": 93, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 15, + 248044 + ], + "response": "20<|endoftext|>", + "stop": "eos", + "answer": 20, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 24, + 248046 + ], + "response": "99<|im_end|>", + "stop": "eos", + "answer": 99, + "correct": false + } + } + }, + { + "id": "test-lookup-018", + "task": "lookup", + "gold": 30, + "arms": { + "native": { + "tokens": [ + 18, + 15, + 248046 + ], + "response": "30<|im_end|>", + "stop": "eos", + "answer": 30, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "lisa": { + "tokens": [ + 20, + 17, + 248046 + ], + "response": "52<|im_end|>", + "stop": "eos", + "answer": 52, + "correct": false + } + } + }, + { + "id": "test-lookup-019", + "task": "lookup", + "gold": 44, + "arms": { + "native": { + "tokens": [ + 19, + 19, + 248046 + ], + "response": "44<|im_end|>", + "stop": "eos", + "answer": 44, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 19, + 24, + 248046 + ], + "response": "49<|im_end|>", + "stop": "eos", + "answer": 49, + "correct": false + } + } + }, + { + "id": "test-lookup-020", + "task": "lookup", + "gold": 94, + "arms": { + "native": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": true + }, + "direct": { + "tokens": [ + 20, + 248044 + ], + "response": "5<|endoftext|>", + "stop": "eos", + "answer": 5, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": true + } + } + }, + { + "id": "test-lookup-021", + "task": "lookup", + "gold": 44, + "arms": { + "native": { + "tokens": [ + 19, + 19, + 248046 + ], + "response": "44<|im_end|>", + "stop": "eos", + "answer": 44, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 19, + 19, + 248046 + ], + "response": "44<|im_end|>", + "stop": "eos", + "answer": 44, + "correct": true + } + } + }, + { + "id": "test-lookup-022", + "task": "lookup", + "gold": 30, + "arms": { + "native": { + "tokens": [ + 18, + 15, + 248046 + ], + "response": "30<|im_end|>", + "stop": "eos", + "answer": 30, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 15, + 248044 + ], + "response": "100<|endoftext|>", + "stop": "eos", + "answer": 100, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 24, + 248046 + ], + "response": "99<|im_end|>", + "stop": "eos", + "answer": 99, + "correct": false + } + } + }, + { + "id": "test-lookup-023", + "task": "lookup", + "gold": 31, + "arms": { + "native": { + "tokens": [ + 18, + 16, + 248046 + ], + "response": "31<|im_end|>", + "stop": "eos", + "answer": 31, + "correct": true + }, + "direct": { + "tokens": [ + 18, + 21, + 248044 + ], + "response": "36<|endoftext|>", + "stop": "eos", + "answer": 36, + "correct": false + }, + "lisa": { + "tokens": [ + 19, + 15, + 248046 + ], + "response": "40<|im_end|>", + "stop": "eos", + "answer": 40, + "correct": false + } + } + }, + { + "id": "test-lookup-024", + "task": "lookup", + "gold": 29, + "arms": { + "native": { + "tokens": [ + 17, + 24, + 248046 + ], + "response": "29<|im_end|>", + "stop": "eos", + "answer": 29, + "correct": true + }, + "direct": { + "tokens": [ + 19, + 248044 + ], + "response": "4<|endoftext|>", + "stop": "eos", + "answer": 4, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 20, + 248046 + ], + "response": "95<|im_end|>", + "stop": "eos", + "answer": 95, + "correct": false + } + } + }, + { + "id": "test-lookup-025", + "task": "lookup", + "gold": 84, + "arms": { + "native": { + "tokens": [ + 23, + 19, + 248046 + ], + "response": "84<|im_end|>", + "stop": "eos", + "answer": 84, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 15, + 248046 + ], + "response": "90<|im_end|>", + "stop": "eos", + "answer": 90, + "correct": false + } + } + }, + { + "id": "test-lookup-026", + "task": "lookup", + "gold": 29, + "arms": { + "native": { + "tokens": [ + 17, + 24, + 248046 + ], + "response": "29<|im_end|>", + "stop": "eos", + "answer": 29, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": false + } + } + }, + { + "id": "test-lookup-027", + "task": "lookup", + "gold": 89, + "arms": { + "native": { + "tokens": [ + 23, + 24, + 248046 + ], + "response": "89<|im_end|>", + "stop": "eos", + "answer": 89, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 16, + 248044 + ], + "response": "21<|endoftext|>", + "stop": "eos", + "answer": 21, + "correct": false + }, + "lisa": { + "tokens": [ + 19, + 16, + 248046 + ], + "response": "41<|im_end|>", + "stop": "eos", + "answer": 41, + "correct": false + } + } + }, + { + "id": "test-lookup-028", + "task": "lookup", + "gold": 63, + "arms": { + "native": { + "tokens": [ + 21, + 18, + 248046 + ], + "response": "63<|im_end|>", + "stop": "eos", + "answer": 63, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 15, + 248044 + ], + "response": "10<|endoftext|>", + "stop": "eos", + "answer": 10, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 21, + 248046 + ], + "response": "96<|im_end|>", + "stop": "eos", + "answer": 96, + "correct": false + } + } + }, + { + "id": "test-lookup-029", + "task": "lookup", + "gold": 40, + "arms": { + "native": { + "tokens": [ + 19, + 15, + 248046 + ], + "response": "40<|im_end|>", + "stop": "eos", + "answer": 40, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 21, + 248044 + ], + "response": "26<|endoftext|>", + "stop": "eos", + "answer": 26, + "correct": false + }, + "lisa": { + "tokens": [ + 21, + 20, + 248046 + ], + "response": "65<|im_end|>", + "stop": "eos", + "answer": 65, + "correct": false + } + } + }, + { + "id": "test-lookup-030", + "task": "lookup", + "gold": 39, + "arms": { + "native": { + "tokens": [ + 18, + 24, + 248046 + ], + "response": "39<|im_end|>", + "stop": "eos", + "answer": 39, + "correct": true + }, + "direct": { + "tokens": [ + 16, + 16, + 248044 + ], + "response": "11<|endoftext|>", + "stop": "eos", + "answer": 11, + "correct": false + }, + "lisa": { + "tokens": [ + 21, + 19, + 248046 + ], + "response": "64<|im_end|>", + "stop": "eos", + "answer": 64, + "correct": false + } + } + }, + { + "id": "test-lookup-031", + "task": "lookup", + "gold": 61, + "arms": { + "native": { + "tokens": [ + 21, + 16, + 248046 + ], + "response": "61<|im_end|>", + "stop": "eos", + "answer": 61, + "correct": true + }, + "direct": { + "tokens": [ + 17, + 24, + 248044 + ], + "response": "29<|endoftext|>", + "stop": "eos", + "answer": 29, + "correct": false + }, + "lisa": { + "tokens": [ + 24, + 19, + 248046 + ], + "response": "94<|im_end|>", + "stop": "eos", + "answer": 94, + "correct": false + } + } + } +] diff --git a/results/lisa-full-answer-reproduction/trace.json b/results/lisa-full-answer-reproduction/trace.json new file mode 100644 index 0000000..1aef002 --- /dev/null +++ b/results/lisa-full-answer-reproduction/trace.json @@ -0,0 +1,547 @@ +{ + "selected_epoch": 2, + "epochs": [ + { + "epoch": 1, + "steps": [ + { + "capture": "000.npz", + "huber": 6.466125965118408, + "completion_ce": 3.640169858932495 + }, + { + "capture": "001.npz", + "huber": 6.416173458099365, + "completion_ce": 2.7350101470947266 + }, + { + "capture": "002.npz", + "huber": 6.482085704803467, + "completion_ce": 2.03899884223938 + }, + { + "capture": "003.npz", + "huber": 6.430853366851807, + "completion_ce": 1.5210151672363281 + }, + { + "capture": "004.npz", + "huber": 6.329977512359619, + "completion_ce": 1.6759847402572632 + }, + { + "capture": "005.npz", + "huber": 6.335151195526123, + "completion_ce": 1.0699304342269897 + }, + { + "capture": "006.npz", + "huber": 6.317526340484619, + "completion_ce": 1.4101346731185913 + }, + { + "capture": "007.npz", + "huber": 6.251140594482422, + "completion_ce": 1.1468429565429688 + }, + { + "capture": "008.npz", + "huber": 6.1668524742126465, + "completion_ce": 1.6777559518814087 + }, + { + "capture": "009.npz", + "huber": 6.1963043212890625, + "completion_ce": 1.2596086263656616 + }, + { + "capture": "010.npz", + "huber": 6.088558673858643, + "completion_ce": 0.6729698181152344 + }, + { + "capture": "011.npz", + "huber": 6.079294681549072, + "completion_ce": 1.2998491525650024 + }, + { + "capture": "012.npz", + "huber": 6.054551601409912, + "completion_ce": 1.4103832244873047 + }, + { + "capture": "013.npz", + "huber": 5.936060428619385, + "completion_ce": 1.0076059103012085 + }, + { + "capture": "014.npz", + "huber": 5.830902576446533, + "completion_ce": 0.8567708134651184 + }, + { + "capture": "015.npz", + "huber": 5.81991720199585, + "completion_ce": 0.9816989898681641 + }, + { + "capture": "016.npz", + "huber": 5.782172679901123, + "completion_ce": 0.32713380455970764 + }, + { + "capture": "017.npz", + "huber": 5.763124465942383, + "completion_ce": 2.0601158142089844 + }, + { + "capture": "018.npz", + "huber": 5.706521511077881, + "completion_ce": 1.5579833984375 + }, + { + "capture": "019.npz", + "huber": 5.558866500854492, + "completion_ce": 0.44708251953125 + }, + { + "capture": "020.npz", + "huber": 5.477881908416748, + "completion_ce": 1.1636791229248047 + }, + { + "capture": "021.npz", + "huber": 5.311099529266357, + "completion_ce": 1.1208223104476929 + }, + { + "capture": "022.npz", + "huber": 5.279181957244873, + "completion_ce": 1.268227219581604 + }, + { + "capture": "023.npz", + "huber": 5.142008304595947, + "completion_ce": 0.9710490107536316 + } + ], + "validation": [ + { + "id": "validation-lookup-000", + "task": "lookup", + "gold": 28, + "arms": { + "lisa": { + "tokens": [ + 24, + 22, + 248046 + ], + "response": "97<|im_end|>", + "stop": "eos", + "answer": 97, + "correct": false + } + } + }, + { + "id": "validation-lookup-001", + "task": "lookup", + "gold": 92, + "arms": { + "lisa": { + "tokens": [ + 24, + 21, + 248046 + ], + "response": "96<|im_end|>", + "stop": "eos", + "answer": 96, + "correct": false + } + } + }, + { + "id": "validation-lookup-002", + "task": "lookup", + "gold": 71, + "arms": { + "lisa": { + "tokens": [ + 19, + 16, + 248046 + ], + "response": "41<|im_end|>", + "stop": "eos", + "answer": 41, + "correct": false + } + } + }, + { + "id": "validation-lookup-003", + "task": "lookup", + "gold": 89, + "arms": { + "lisa": { + "tokens": [ + 23, + 19, + 248046 + ], + "response": "84<|im_end|>", + "stop": "eos", + "answer": 84, + "correct": false + } + } + }, + { + "id": "validation-lookup-004", + "task": "lookup", + "gold": 98, + "arms": { + "lisa": { + "tokens": [ + 24, + 23, + 248046 + ], + "response": "98<|im_end|>", + "stop": "eos", + "answer": 98, + "correct": true + } + } + }, + { + "id": "validation-lookup-005", + "task": "lookup", + "gold": 26, + "arms": { + "lisa": { + "tokens": [ + 20, + 24, + 248046 + ], + "response": "59<|im_end|>", + "stop": "eos", + "answer": 59, + "correct": false + } + } + }, + { + "id": "validation-lookup-006", + "task": "lookup", + "gold": 38, + "arms": { + "lisa": { + "tokens": [ + 24, + 16, + 248046 + ], + "response": "91<|im_end|>", + "stop": "eos", + "answer": 91, + "correct": false + } + } + }, + { + "id": "validation-lookup-007", + "task": "lookup", + "gold": 32, + "arms": { + "lisa": { + "tokens": [ + 20, + 24, + 248046 + ], + "response": "59<|im_end|>", + "stop": "eos", + "answer": 59, + "correct": false + } + } + } + ] + }, + { + "epoch": 2, + "steps": [ + { + "capture": "000.npz", + "huber": 4.952552318572998, + "completion_ce": 1.4009037017822266 + }, + { + "capture": "001.npz", + "huber": 4.789427280426025, + "completion_ce": 0.5592880249023438 + }, + { + "capture": "002.npz", + "huber": 4.726945400238037, + "completion_ce": 1.2972265481948853 + }, + { + "capture": "003.npz", + "huber": 4.5856170654296875, + "completion_ce": 0.5974127650260925 + }, + { + "capture": "004.npz", + "huber": 4.457610607147217, + "completion_ce": 0.4448140561580658 + }, + { + "capture": "005.npz", + "huber": 4.406347274780273, + "completion_ce": 0.6005427241325378 + }, + { + "capture": "006.npz", + "huber": 4.3611578941345215, + "completion_ce": 1.11090087890625 + }, + { + "capture": "007.npz", + "huber": 4.287736415863037, + "completion_ce": 0.4663238525390625 + }, + { + "capture": "008.npz", + "huber": 4.187578201293945, + "completion_ce": 1.04208242893219 + }, + { + "capture": "009.npz", + "huber": 4.137438774108887, + "completion_ce": 0.754715621471405 + }, + { + "capture": "010.npz", + "huber": 3.979546308517456, + "completion_ce": 0.5380516052246094 + }, + { + "capture": "011.npz", + "huber": 3.8709640502929688, + "completion_ce": 0.7800388336181641 + }, + { + "capture": "012.npz", + "huber": 3.749253273010254, + "completion_ce": 0.5718275904655457 + }, + { + "capture": "013.npz", + "huber": 3.5951597690582275, + "completion_ce": 0.8369833827018738 + }, + { + "capture": "014.npz", + "huber": 3.4549624919891357, + "completion_ce": 0.37712350487709045 + }, + { + "capture": "015.npz", + "huber": 3.3932430744171143, + "completion_ce": 0.47049713134765625 + }, + { + "capture": "016.npz", + "huber": 3.3298141956329346, + "completion_ce": 0.24415016174316406 + }, + { + "capture": "017.npz", + "huber": 3.315248727798462, + "completion_ce": 1.5147151947021484 + }, + { + "capture": "018.npz", + "huber": 3.2439496517181396, + "completion_ce": 0.15868441760540009 + }, + { + "capture": "019.npz", + "huber": 3.1188666820526123, + "completion_ce": 0.05583127215504646 + }, + { + "capture": "020.npz", + "huber": 3.04500412940979, + "completion_ce": 0.022246679291129112 + }, + { + "capture": "021.npz", + "huber": 2.903524160385132, + "completion_ce": 0.07955551147460938 + }, + { + "capture": "022.npz", + "huber": 2.9015865325927734, + "completion_ce": 1.1182270050048828 + }, + { + "capture": "023.npz", + "huber": 2.8223178386688232, + "completion_ce": 0.44306373596191406 + } + ], + "validation": [ + { + "id": "validation-lookup-000", + "task": "lookup", + "gold": 28, + "arms": { + "lisa": { + "tokens": [ + 24, + 22, + 248046 + ], + "response": "97<|im_end|>", + "stop": "eos", + "answer": 97, + "correct": false + } + } + }, + { + "id": "validation-lookup-001", + "task": "lookup", + "gold": 92, + "arms": { + "lisa": { + "tokens": [ + 24, + 17, + 248046 + ], + "response": "92<|im_end|>", + "stop": "eos", + "answer": 92, + "correct": true + } + } + }, + { + "id": "validation-lookup-002", + "task": "lookup", + "gold": 71, + "arms": { + "lisa": { + "tokens": [ + 19, + 16, + 248046 + ], + "response": "41<|im_end|>", + "stop": "eos", + "answer": 41, + "correct": false + } + } + }, + { + "id": "validation-lookup-003", + "task": "lookup", + "gold": 89, + "arms": { + "lisa": { + "tokens": [ + 20, + 19, + 248046 + ], + "response": "54<|im_end|>", + "stop": "eos", + "answer": 54, + "correct": false + } + } + }, + { + "id": "validation-lookup-004", + "task": "lookup", + "gold": 98, + "arms": { + "lisa": { + "tokens": [ + 24, + 23, + 248046 + ], + "response": "98<|im_end|>", + "stop": "eos", + "answer": 98, + "correct": true + } + } + }, + { + "id": "validation-lookup-005", + "task": "lookup", + "gold": 26, + "arms": { + "lisa": { + "tokens": [ + 21, + 20, + 248046 + ], + "response": "65<|im_end|>", + "stop": "eos", + "answer": 65, + "correct": false + } + } + }, + { + "id": "validation-lookup-006", + "task": "lookup", + "gold": 38, + "arms": { + "lisa": { + "tokens": [ + 24, + 16, + 248046 + ], + "response": "91<|im_end|>", + "stop": "eos", + "answer": 91, + "correct": false + } + } + }, + { + "id": "validation-lookup-007", + "task": "lookup", + "gold": 32, + "arms": { + "lisa": { + "tokens": [ + 20, + 18, + 248046 + ], + "response": "53<|im_end|>", + "stop": "eos", + "answer": 53, + "correct": false + } + } + } + ] + } + ] +} diff --git a/results/lisa-full-answer-reproduction/verified-test.json b/results/lisa-full-answer-reproduction/verified-test.json new file mode 100644 index 0000000..546d03e --- /dev/null +++ b/results/lisa-full-answer-reproduction/verified-test.json @@ -0,0 +1,68 @@ +{ + "frozen_sha256": "409cadff8b2ef2f0efcfa71bf0a94802391a341ed04cb6e374154b8b8ff1b545", + "rows_sha256": "5c04ffff27c8b31a0be2d39553ed035d3c677907cabc1d17a9ea5886f97f8e5d", + "rows_verified": 32, + "final_answer_audit": { + "n": 32, + "correct": { + "native": 32, + "direct": 0, + "lisa": 3 + }, + "substantive_loss_ids": [ + "test-lookup-000", + "test-lookup-001", + "test-lookup-002", + "test-lookup-003", + "test-lookup-004", + "test-lookup-005", + "test-lookup-006", + "test-lookup-007", + "test-lookup-008", + "test-lookup-009", + "test-lookup-010", + "test-lookup-011", + "test-lookup-012", + "test-lookup-013", + "test-lookup-014", + "test-lookup-015", + "test-lookup-016", + "test-lookup-017", + "test-lookup-018", + "test-lookup-019", + "test-lookup-020", + "test-lookup-021", + "test-lookup-022", + "test-lookup-023", + "test-lookup-024", + "test-lookup-025", + "test-lookup-026", + "test-lookup-027", + "test-lookup-028", + "test-lookup-029", + "test-lookup-030", + "test-lookup-031" + ], + "substantive_rescued_ids": [ + "test-lookup-014", + "test-lookup-020", + "test-lookup-021" + ], + "unscored": { + "native": 0, + "direct": 0, + "lisa": 0 + }, + "native_correct_lost_by_direct": 32, + "rescued": 3, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 3, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.09375, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.21875 + ], + "mcnemar_exact_p": 0.25 + } +}