From 1c8943a2e8814efc6ab1abf70d17acda370bcd5d Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 00:00:42 +0800 Subject: [PATCH 1/4] Add controlled two-layer LiSA reproduction on Qwen --- crossqkv/lisa_decode.py | 101 ++ crossqkv/lisa_decode_bench.py | 130 ++ crossqkv/lisa_effect.py | 296 ++++ crossqkv/lisa_effect_answer_audit.py | 115 ++ crossqkv/lisa_effect_audit.py | 98 ++ crossqkv/lisa_effect_screen.py | 183 ++ crossqkv/lisa_tail.py | 173 ++ crossqkv/lisa_train.py | 16 +- docs/LISA_EFFECT_PROTOCOL.md | 151 ++ .../development-native-reference.json | 10 + .../fixed-problems.json | 1546 +++++++++++++++++ .../real-model-preflight.json | 12 + results/lisa-effect-reproduction/runtime.json | 40 + .../lisa-effect-reproduction/screen-rows.json | 1186 +++++++++++++ .../screen-summary.json | 82 + .../lisa-effect-reproduction/selection.json | 13 + tests/test_lisa_effect_audit.py | 30 + tests/test_lisa_effect_resume.py | 62 + tests/test_lisa_effect_screen.py | 53 + tests/test_lisa_tail.py | 138 ++ tests/test_lisa_train.py | 16 + 21 files changed, 4444 insertions(+), 7 deletions(-) create mode 100644 crossqkv/lisa_decode.py create mode 100644 crossqkv/lisa_decode_bench.py create mode 100644 crossqkv/lisa_effect.py create mode 100644 crossqkv/lisa_effect_answer_audit.py create mode 100644 crossqkv/lisa_effect_audit.py create mode 100644 crossqkv/lisa_effect_screen.py create mode 100644 crossqkv/lisa_tail.py create mode 100644 docs/LISA_EFFECT_PROTOCOL.md create mode 100644 results/lisa-effect-reproduction/development-native-reference.json create mode 100644 results/lisa-effect-reproduction/fixed-problems.json create mode 100644 results/lisa-effect-reproduction/real-model-preflight.json create mode 100644 results/lisa-effect-reproduction/runtime.json create mode 100644 results/lisa-effect-reproduction/screen-rows.json create mode 100644 results/lisa-effect-reproduction/screen-summary.json create mode 100644 results/lisa-effect-reproduction/selection.json create mode 100644 tests/test_lisa_effect_audit.py create mode 100644 tests/test_lisa_effect_resume.py create mode 100644 tests/test_lisa_effect_screen.py create mode 100644 tests/test_lisa_tail.py diff --git a/crossqkv/lisa_decode.py b/crossqkv/lisa_decode.py new file mode 100644 index 0000000..73a3496 --- /dev/null +++ b/crossqkv/lisa_decode.py @@ -0,0 +1,101 @@ +"""Incremental full-attention sites for measuring LiSA's real K/V allocation. + +The scheduler supplies the earlier full-attention site's raw score row for +the same query. This file measures an attention site, excluding GDN, MLP, +embedding, and scheduler overhead. +""" +import math + +import torch + +from crossqkv.lisa_tail import TorchTail, rotate + + +class AttentionSiteCache: + def __init__(self, tail: TorchTail, layer, batch_size, capacity, adapter=None, + dtype=torch.float32): + self.tail, self.adapter = tail, adapter + self.name = f'layers.{layer}.self_attn.' + self.heads = tail.c['num_attention_heads'] + self.kv_heads = tail.c['num_key_value_heads'] + self.head_dim = tail.c['head_dim'] + self.key_dim = adapter.rank if adapter is not None else self.head_dim + self.capacity = capacity + self.next_position = 0 + self.k = torch.empty(batch_size, capacity, self.kv_heads, self.key_dim, dtype=dtype) + self.v = torch.empty(batch_size, capacity, self.kv_heads, self.head_dim, dtype=dtype) + rp = tail.c['rope_parameters'] + n = int(self.head_dim * rp['partial_rotary_factor']) + self.rotary_frequency = rp['rope_theta'] ** (-torch.arange(0, n, 2, dtype=dtype) / n) + + def reset(self): + self.next_position = 0 + + @property + def allocated_bytes(self): + return {'k': self.k.numel()*self.k.element_size(), + 'v': self.v.numel()*self.v.element_size()} + + def native_rotate(self, x, position): + angle = self.rotary_frequency * position + a, b = x[..., :2*len(angle)].chunk(2, -1) + angle = torch.cat((angle, angle)) + return torch.cat((torch.cat((a, b), -1)*angle.cos() + + torch.cat((-b, a), -1)*angle.sin(), + x[..., 2*len(self.rotary_frequency):]), -1) + + @torch.no_grad() + def prefill(self, h): + """Populate K/V from a fresh prefix without scoring its queries.""" + n = h.shape[1] + if h.shape[0] != self.k.shape[0] or n > self.capacity: + raise ValueError('Prefix does not fit the attention cache') + base, name = self.tail, self.name + if self.adapter is None: + rp = base.c['rope_parameters'] + k = base.linear(h, name+'k_proj').unflatten(-1, (self.kv_heads, self.head_dim)) + k = rotate(base.norm(k, name+'k_norm'), rp['rope_theta'], rp['partial_rotary_factor']) + else: + a = self.adapter + k = a.k_proj(h).unflatten(-1, (self.kv_heads, self.key_dim)) + k = a.rotate(k, torch.arange(n, device=h.device)[None, :]) + self.k[:, :n].copy_(k) + self.v[:, :n].copy_(base.linear(h, name+'v_proj').unflatten(-1, (self.kv_heads, self.head_dim))) + self.next_position = n + + @torch.no_grad() + def step(self, h, donor=None): + """h has shape (batch, 1, hidden). Return output and unmasked score row.""" + pos = self.next_position + if h.shape[:2] != (self.k.shape[0], 1) or pos >= self.capacity: + raise ValueError('Wrong input shape or full attention cache') + if self.adapter is not None and (donor is None or + donor.shape != (len(h), self.heads, 1, pos+1)): + raise ValueError('LiSA requires the upstream score row for its full prefix') + base = self.tail + name = self.name + if self.adapter is None: + packed = base.linear(h, name+'q_proj').unflatten(-1, (self.heads, 2*self.head_dim)) + q, gate = packed.chunk(2, -1) + k = base.linear(h, name+'k_proj').unflatten(-1, (self.kv_heads, self.head_dim)) + q = self.native_rotate(base.norm(q, name+'q_norm'), pos) + k = self.native_rotate(base.norm(k, name+'k_norm'), pos) + else: + a = self.adapter + position = torch.tensor([[pos]], device=h.device) + q = a.rotate(a.q_proj(h).unflatten(-1, (self.heads, self.key_dim)), position) + k = a.rotate(a.k_proj(h).unflatten(-1, (self.kv_heads, self.key_dim)), position) + gate = base.gate_only(h, name) + v = base.linear(h, name+'v_proj').unflatten(-1, (self.kv_heads, self.head_dim)) + self.k[:, pos:pos+1].copy_(k) + self.v[:, pos:pos+1].copy_(v) + self.next_position += 1 + groups = self.heads // self.kv_heads + keys = self.k[:, :pos+1].repeat_interleave(groups, 2) + values = self.v[:, :pos+1].repeat_interleave(groups, 2) + scores = torch.einsum('bthd,bshd->bhts', q, keys) / math.sqrt(self.key_dim) + if self.adapter is not None: + both = torch.cat((scores, donor), dim=1).permute(0, 2, 3, 1) + scores = self.adapter.fuse(both).permute(0, 3, 1, 2) + context = torch.einsum('bhts,bshd->bthd', scores.softmax(-1), values) + return base.linear((context * gate.sigmoid()).flatten(-2), name+'o_proj'), scores diff --git a/crossqkv/lisa_decode_bench.py b/crossqkv/lisa_decode_bench.py new file mode 100644 index 0000000..2348c74 --- /dev/null +++ b/crossqkv/lisa_decode_bench.py @@ -0,0 +1,130 @@ +"""Measure real K/V allocation and isolated incremental attention on Qwen.""" +import argparse +import json +import time +from statistics import median +from pathlib import Path + +import numpy as np +import torch +from torch.nn import functional as F + +from crossqkv.lisa_decode import AttentionSiteCache +from crossqkv.lisa_tail import TorchTail, weight_chunks +from crossqkv.lisa_train import LearnableSharingAttention +from functional.model import PREFIX, StreamingLM +from functional.run import write_json + + +class TracedTail(TorchTail): + def full(self, h, layer, donor, lengths, mode, recipients, keep_teacher): + self.inputs[layer] = (h, donor) + return super().full(h, layer, donor, lengths, mode, recipients, keep_teacher) + + +class ResidentSite: + """Keep one site's frozen projections resident to isolate compute latency.""" + + def __init__(self, tail, layer): + self.tail, self.c = tail, tail.c + self.name = f'layers.{layer}.self_attn.' + self.weights = {} + for k in ('q_proj', 'k_proj', 'v_proj', 'o_proj'): + t = tail.source.tensors[PREFIX + self.name + k + '.weight'] + self.weights[self.name+k] = torch.cat(list(weight_chunks(t, 0, t.shape[0]))) + w = self.weights[self.name+'q_proj'] + heads, dim = self.c['num_attention_heads'], self.c['head_dim'] + self.gate_weight = w.reshape(heads, 2*dim, -1)[:, dim:].reshape(heads*dim, -1).contiguous() + + def linear(self, h, name, start=0, end=None): + return F.linear(h, self.weights[name][start:end]) + + def gate_only(self, h, name): + if name != self.name: + raise ValueError('Resident gate called for the wrong site') + return F.linear(h, self.gate_weight).unflatten(-1, + (self.c['num_attention_heads'], self.c['head_dim'])) + + def norm(self, *args): + return self.tail.norm(*args) + + +def timed_site(groups, h, donor, n, samples=3, rounds=4): + timings = {k: [] for k in groups} + states = {} + for i in range(rounds): + order = tuple(groups) if i % 2 == 0 else tuple(reversed(groups)) + for mode in order: + cache = groups[mode] + cache.reset() + cache.prefill(h[:, :n-samples]) + for pos in range(n-samples, n): + row = donor[:, :, pos:pos+1, :pos+1].contiguous() if mode == 'lisa' else None + start = time.perf_counter() + result, attention = cache.step(h[:, pos:pos+1], row) + elapsed = time.perf_counter() - start + if i: + timings[mode].append(elapsed) + if not torch.isfinite(result).all(): + raise FloatingPointError('Invalid cached decode') + states[mode] = result, attention + return timings, states + + +def run(source, capture, checkpoint, out): + torch.set_num_threads(1) + spec = json.loads((capture/'selection.json').read_text()) + sites = spec['sites'] + source = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text())) + cfg = source.config + rope = cfg['rope_parameters'] + adap = {i: LearnableSharingAttention(cfg['hidden_size'], cfg['num_attention_heads'], + cfg['num_key_value_heads'], 40, rope['rope_theta'], rope['partial_rotary_factor'], + bias=cfg.get('attention_bias', False)) for i in sites} + tail = TracedTail(source, sites[0], adap) + tail.adapters.load_state_dict(torch.load(checkpoint, map_location='cpu', weights_only=True)) + with np.load(sorted(capture.glob('validation-*.npz'))[0], allow_pickle=False) as f: + n = int(f['lengths'][0]) + data = {k: torch.from_numpy(f[k][:1]) for k in ('residual', 'donor', 'lengths')} + data['residual'] = data['residual'][:, :n] + data['donor'] = data['donor'][:, :, :n, :n] + tail.inputs = {} + measurements = {} + with torch.no_grad(): + tail(data['residual'], data['donor'], data['lengths'], 'native', ()) + for layer in sites: + h, donor = tail.inputs[layer] + groups = {'native': AttentionSiteCache(tail, layer, 1, n), + 'lisa': AttentionSiteCache(tail, layer, 1, n, adap[layer])} + timings, reference = timed_site(groups, h, donor, n) + resident = ResidentSite(tail, layer) + resident_groups = {mode: AttentionSiteCache(resident, layer, 1, n, + adap[layer] if mode == 'lisa' else None) for mode in groups} + warm, checked = timed_site(resident_groups, h, donor, n) + for mode in groups: + for actual, expected in zip(checked[mode], reference[mode]): + torch.testing.assert_close(actual, expected, rtol=5e-5, atol=5e-5) + measurements[layer] = {'seconds_per_token': timings, + 'resident_seconds_per_token': warm, + 'resident_median_s_per_token': {k: median(v) for k,v in warm.items()}, + 'resident_matches_streamed': True, + 'allocated_bytes': {k: v.allocated_bytes for k, v in groups.items()}, + 'lisa_input_score_row_bytes': ( + cfg['num_attention_heads'] * n * h.element_size()), + 'sequence_length': n} + write_json(out, {'scope': 'isolated full-attention recipient, FP32, frozen true activations; ' + 'excludes donor generation and full-model decode', 'sites': measurements, + 'streamed_timings_include_weight_reads': True, + 'resident_timings_exclude_projection_load': True}) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + for name in ('source', 'capture', 'checkpoint', 'out'): + p.add_argument('--'+name, type=Path, required=True) + a = p.parse_args() + run(a.source, a.capture, a.checkpoint, a.out) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_effect.py b/crossqkv/lisa_effect.py new file mode 100644 index 0000000..0b9766c --- /dev/null +++ b/crossqkv/lisa_effect.py @@ -0,0 +1,296 @@ +"""Train matched multi-recipient sharing adapters and evaluate the frozen test set.""" +import argparse +import hashlib +import json +import time +from pathlib import Path + +import numpy as np + +from crossqkv.core import QKVModel +from crossqkv.lisa_effect_screen import TASKS +from crossqkv.lisa_pilot import batch, scores +from functional.model import PREFIX +from functional.run import write_json + +CANDIDATES = ('linear', 'lisa', 'lisa_answer_weighted') + + +def selection(screen): + eligible = [] + for task, modes in screen.items(): + base = modes['native'] + if base['correct'] < 5: + continue + for name, sites in [('direct_23', [23]), ('direct_19_23', [19, 23])]: + row = modes[name] + if row['native_wins_lost']: + eligible.append((row['native_wins_lost'], len(sites), + base['correct']-row['correct'], task, sites)) + if not eligible: + raise ValueError('No task/schedule met the prespecified development eligibility rule') + _, _, _, task, sites = max(eligible) + return {'task': task, 'sites': sites} + + +class Capture(QKVModel): + def normalization(self, x, name): + if name == f'layers.{self.first}.input_layernorm': + self.residual = x + return super().normalization(x, name) + + def full_attention(self, h, layer, shared_p=None): + if layer != self.first - 4: + return super().full_attention(h, layer, shared_p) + part = self.parts(h, layer, heads=False) + self.donor = scores(part['q'], part['k']) + return part['output'], part['p'] + + +def capture(source, screen_dir, out, schedule): + from tokenizers import Tokenizer + + fixed_path = screen_dir/'fixed-problems.json' + fixed = json.loads(fixed_path.read_text()) + chosen = selection(json.loads((screen_dir/'screen-summary.json').read_text())) + if schedule == 'chain': + modes = json.loads((screen_dir/'screen-summary.json').read_text())[chosen['task']] + if not modes['direct_19_23']['native_wins_lost']: + raise ValueError('The development-selected task has no recorded losses under the chain') + chosen['sites'] = [19, 23] + model = Capture(source/'weights', json.loads((source/'model_config.json').read_text()), + seconds=7200) + model.first = chosen['sites'][0] + tok = Tokenizer.from_file(str(source/'tokenizer.json')) + sha = lambda path: hashlib.sha256(path.read_bytes()).hexdigest() + write_json(out/'selection.json', {**chosen, 'fixed_problems_sha256': sha(fixed_path), + 'source_sha256': {n: sha(source/n) for n in + ('manifest.json', 'model_config.json', 'tokenizer.json')}}) + for split in ('fit', 'validation', 'test'): + selected = [ex for ex in fixed[split] if ex['task'] == chosen['task']] + for start in range(0, len(selected), 4): + group = selected[start:start+4] + ids, lengths, labels = batch(tok, group) + gold = np.array([r['answer_index'] for r in group]) + ids = np.pad(ids, ((0, 0), (0, 1))) + ids[np.arange(len(group)), lengths] = np.asarray(labels)[gold] + h, _ = model.forward(ids) + pending = out/f'{split}-{start:03}.tmp.npz' + np.savez(pending, ids=ids, lengths=np.asarray(lengths)+1, labels=labels, gold=gold, + residual=model.residual, donor=model.donor, expected=h, + names=[x['id'] for x in group]) + pending.replace(out/f'{split}-{start:03}.npz') + print('capture', split, start+len(group), '/', len(selected), flush=True) + + +def train(source, cache, out, epochs, resume=False): + import torch + from torch import nn + from crossqkv.lisa_tail import TorchTail + from crossqkv.lisa_train import LearnableSharingAttention, huber_distillation, language_model_loss + from functional.model import StreamingLM + + torch.set_num_threads(1) + torch.manual_seed(415005) + spec = json.loads((cache/'selection.json').read_text()) + if any(hashlib.sha256((source/n).read_bytes()).hexdigest() != s + for n, s in spec['source_sha256'].items()): + raise ValueError('Checkpoint provenance mismatch') + expected_batches = {'fit':12, 'validation':12, 'test':32} + for split, count in expected_batches.items(): + actual = 0 + for p in cache.glob(f'{split}-*.npz'): + with np.load(p, allow_pickle=False) as b: + actual += len(b['names']) + if actual != count: + raise ValueError(f'Expected {count} {split} examples, found {actual}') + run_config = {'epochs': epochs, 'selection': spec, 'optimizer': 'AdamW', + 'lr': .0003, 'weight_decay': .1, 'answer_weight': 16., 'seed': 415005} + config_path = out/'train-protocol.json' + if resume: + if json.loads(config_path.read_text()) != run_config: + raise ValueError('Training configuration differs from the original run') + else: + write_json(config_path, run_config) + model = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text())) + sites = tuple(spec['sites']) + cfg = model.config + heads = cfg['num_attention_heads'] + rope = cfg['rope_parameters'] + t = model.tensors[PREFIX+'embed_tokens.weight'] + + def vocab(): + for start in range(0, t.shape[0], 1024): + end = min(start+1024, t.shape[0]) + yield start, torch.from_numpy(t.read(slice(start*t.shape[1], end*t.shape[1])) + .reshape(end-start, t.shape[1])) + t.evict() + + def batches(split, micro=False): + for path in sorted(cache.glob(f'{split}-*.npz')): + with np.load(path, allow_pickle=False) as f: + b = {k: torch.from_numpy(f[k]) for k in f.files if k != 'names'} + names = f['names'].tolist() + if not micro: + yield b, names + else: + for j, name in enumerate(names): + yield {k: v if k == 'labels' else v[j:j+1] for k, v in b.items()}, [name] + + def make(candidate): + torch.manual_seed(415005) + if candidate == 'linear': + blocks = {i: nn.Linear(heads, heads, bias=False) for i in sites} + for value in blocks.values(): + with torch.no_grad(): + value.weight.copy_(torch.eye(heads)) + else: + blocks = {i: LearnableSharingAttention(cfg['hidden_size'], heads, + cfg['num_key_value_heads'], 40, rope['rope_theta'], + rope['partial_rotary_factor'], bias=cfg.get('attention_bias', False)) + for i in sites} + return TorchTail(model, sites[0], blocks) + + def run(tail, b, mode, teacher=False): + return tail(b['residual'], b['donor'], b['lengths'], mode, sites, teacher) + + def score(h, b): + index = b['lengths'] - 2 + f = h[torch.arange(len(index)), index] + labels = b['labels'].tolist() + weights = np.stack([t.read(slice(i*t.shape[1], (i+1)*t.shape[1])) for i in labels]) + t.evict() + logits = f @ torch.from_numpy(weights).T + nll = torch.logsumexp(logits, -1) - logits[torch.arange(len(index)), b['gold']] + return logits, nll + + def evaluate(tail, split, mode): + rows = [] + with torch.no_grad(): + for b, names in batches(split): + h, _ = run(tail, b, mode) + if mode == 'native': + valid = torch.arange(h.shape[1])[None] < b['lengths'][:, None] + torch.testing.assert_close(h[valid], b['expected'][valid], rtol=7e-5, atol=8e-5) + logits, nll = score(h, b) + rows.extend({'id': name, 'gold': int(g), 'logits': x.tolist(), + 'pred': int(x.argmax()), 'answer_nll': float(v)} + for name, g, x, v in zip(names, b['gold'], logits, nll)) + if not rows: + raise ValueError(f'No cached rows for {split}') + return rows + + def mean_nll(rows): + return sum(r['answer_nll'] for r in rows) / len(rows) + + trace = {} + for candidate in CANDIDATES: + tail = make(candidate) + mode = 'linear' if candidate == 'linear' else 'lisa' + optim = torch.optim.AdamW(tail.parameters(), lr=.0003, weight_decay=.1) + ans_weight = 16.0 if candidate == 'lisa_answer_weighted' else 1.0 + best = float('inf') + best_weights = None + trace[candidate] = [] + last = out/f'{candidate}-resume.pt' + if resume and 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']) + trace[candidate] = state['trace'] + best = state['best'] + best_weights = state['best_parameters'] + for epoch in range(len(trace[candidate]), epochs): + loss_total = 0. + count = 0 + for b, _ in batches('fit', micro=True): + optim.zero_grad(set_to_none=True) + h, layer = run(tail, b, mode, teacher=True) + kd = torch.stack([huber_distillation(*layer[i], b['lengths']) for i in sites]).mean() + ce = None if mode == 'linear' else language_model_loss( + h, b['ids'], b['lengths'], vocab, answer_weight=ans_weight) + loss = kd if ce is None else .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('Invalid adapter gradients') + optim.step() + loss_total += float(loss.detach()) + count += 1 + rows = evaluate(tail, 'validation', mode) + val = mean_nll(rows) + trace[candidate].append({'epoch': epoch+1, 'fit_loss': loss_total/count, + 'validation_answer_nll': val}) + if val < best: + best = val + best_weights = {k: v.detach().clone() for k, v in tail.adapters.state_dict().items()} + pending = last.with_suffix('.tmp') + torch.save({'parameters': tail.adapters.state_dict(), 'optimizer': optim.state_dict(), + 'trace': trace[candidate], 'best': best, 'best_parameters': best_weights}, + pending) + pending.replace(last) + write_json(out/'trace.json', trace) + print(candidate, epoch+1, 'validation answer NLL', val, flush=True) + selected = out/f'{candidate}.pt' + pending = selected.with_suffix('.tmp') + torch.save(best_weights, pending) + pending.replace(selected) + + # All checkpoints are frozen before evaluating holdout. Native and direct + # go through the same path, including numerical parity with NumPy. + results = {} + empty = TorchTail(model, sites[0]) + for mode in ('native', 'direct'): + results[mode] = evaluate(empty, 'test', mode) + for name in CANDIDATES: + tail = make(name) + tail.adapters.load_state_dict(torch.load(out/f'{name}.pt', map_location='cpu', weights_only=True)) + results[name] = evaluate(tail, 'test', 'linear' if name == 'linear' else 'lisa') + write_json(out/'test-items.json', results) + + b, _ = next(batches('validation')) + b = {k: v if k == 'labels' else v[:1] for k, v in b.items()} + trained = make('lisa') + trained.adapters.load_state_dict(torch.load(out/'lisa.pt', weights_only=True)) + timing = {'native': [], 'direct': [], 'lisa': []} + with torch.no_grad(): + for turn in range(4): + modes = list(timing) + for mode in modes[turn % 3:] + modes[:turn % 3]: + t0 = time.perf_counter() + _, _ = run(trained if mode == 'lisa' else empty, b, mode) + if turn: + timing[mode].append(time.perf_counter()-t0) + tokens = int(b['lengths'][0]) + kv, d = cfg['num_key_value_heads'], cfg['head_dim'] + cache_bytes = {'scope': 'formula for one sequence, BF16 keys and score buffers', + 'native_recipient_key_bytes': len(sites)*tokens*kv*d*2, + 'lisa_recipient_key_bytes': len(sites)*tokens*kv*40*2, + 'one_shared_decode_score_row_bytes': heads*tokens*2, + 'one_full_prefill_score_matrix_bytes': heads*tokens*tokens*2} + write_json(out/'performance.json', {'scope': 'cached-prefix last layers, prefill', + 'seconds': timing, 'real_tokens': tokens, 'cache_estimate': cache_bytes}) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('phase', choices=('capture', 'train')) + p.add_argument('--source', required=True, type=Path) + p.add_argument('--input', required=True, type=Path) + p.add_argument('--out', required=True, type=Path) + p.add_argument('--schedule', choices=('best','chain'), default='best') + p.add_argument('--epochs', type=int, default=2) + p.add_argument('--resume', action='store_true') + a = p.parse_args() + if a.epochs < 1: + p.error('--epochs must be positive') + if a.resume and a.phase != 'train': + p.error('--resume is for training with saved epoch checkpoints') + a.out.mkdir(exist_ok=a.resume) + if a.phase == 'capture': + capture(a.source, a.input, a.out, a.schedule) + else: + train(a.source, a.input, a.out, a.epochs, a.resume) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_effect_answer_audit.py b/crossqkv/lisa_effect_answer_audit.py new file mode 100644 index 0000000..5685743 --- /dev/null +++ b/crossqkv/lisa_effect_answer_audit.py @@ -0,0 +1,115 @@ +"""Compare one vs two recipients on the same task using full-vocabulary answers.""" +import argparse +import json +from pathlib import Path + +import numpy as np +import torch +from torch.nn import functional as F + +from crossqkv.lisa_tail import TorchTail, weight_chunks +from crossqkv.lisa_train import LearnableSharingAttention +from functional.model import PREFIX, StreamingLM +from functional.run import write_json + + +def vocabulary_scores(hidden, targets, embedding): + n = len(hidden) + peak = hidden.new_full((n,), -torch.inf) + total = peak.clone() + top = torch.zeros(n, dtype=torch.int64) + true = torch.zeros_like(peak) + start = 0 + for w in weight_chunks(embedding, 0, embedding.shape[0], rows=1024): + logits = F.linear(hidden, w) + total = torch.logaddexp(total, logits.logsumexp(dim=-1)) + values, indices = logits.max(dim=-1) + top = torch.where(values > peak, indices + start, top) + peak = torch.maximum(values, peak) + local = (targets >= start) & (targets < start + len(w)) + true[local] = logits[local, targets[local]-start] + start += len(w) + return top, total-true + + +def run(source, cache, trained, out): + torch.set_num_threads(1) + spec = json.loads((cache/'selection.json').read_text()) + sites = tuple(spec['sites']) + stream = StreamingLM(source/'weights', json.loads((source/'model_config.json').read_text())) + cfg = stream.config + rp = cfg['rope_parameters'] + heads, kv = cfg['num_attention_heads'], cfg['num_key_value_heads'] + + def loaded(mode): + if mode == 'linear': + from torch import nn + + modules = {site: nn.Linear(heads, heads, bias=False) for site in sites} + else: + modules = {site: LearnableSharingAttention(cfg['hidden_size'], heads, kv, 40, + rp['rope_theta'], rp['partial_rotary_factor'], + bias=cfg.get('attention_bias', False)) for site in sites} + tail = TorchTail(stream, sites[0], modules) + tail.adapters.load_state_dict(torch.load(trained/f'{mode}.pt', weights_only=True, + map_location='cpu')) + return tail + + empty = TorchTail(stream, sites[0]) + fitted = loaded('lisa') + arms = [('native', empty, 'native', ()), + ('direct_23', empty, 'direct', (sites[-1],)), + ('lisa_23_ablation', fitted, 'lisa', (sites[-1],))] + if len(sites) > 1: + arms.extend([('direct_chain', empty, 'direct', sites), + ('lisa_chain', fitted, 'lisa', sites)]) + arms.extend([('linear', loaded('linear'), 'linear', sites), + ('lisa_answer_weighted', loaded('lisa_answer_weighted'), 'lisa', sites)]) + answers = {name: [] for name, *_ in arms} + ids, labels, options = [], [], [] + with torch.no_grad(): + for path in sorted(cache.glob('test-*.npz')): + with np.load(path, allow_pickle=False) as f: + b = {k: torch.from_numpy(f[k]) for k in f.files if k != 'names'} + ids.extend(f['names'].tolist()) + labels.append(b['labels'][b['gold']]) + options.append(b['labels'].expand(len(b['gold']), -1)) + for name, tail, mode, chosen in arms: + h, _ = tail(b['residual'], b['donor'], b['lengths'], mode, chosen) + answers[name].append(h[torch.arange(len(h)), b['lengths']-2]) + print('matched full-vocabulary audit', len(ids), flush=True) + if not ids: + raise ValueError('No captured holdout batches') + y = torch.cat(labels) + t = stream.tensors[PREFIX+'embed_tokens.weight'] + hidden = torch.cat([torch.cat(answers[k]) for k in answers]) + pred, nll = vocabulary_scores(hidden, y.repeat(len(answers)), t) + result = {} + opts = torch.cat(options) + for (name, h), p, v in zip(answers.items(), pred.split(len(y)), nll.split(len(y))): + option_w = torch.stack([torch.from_numpy(t.read(slice(i*t.shape[1], (i+1)*t.shape[1]))) + for i in opts[0].tolist()]) + if not torch.equal(opts, opts[0].expand_as(opts)): + raise ValueError('Option token IDs unexpectedly vary across items') + t.evict() + choice = opts[torch.arange(len(y)), F.linear(torch.cat(h), option_w).argmax(-1)] + result[name] = {'n': len(y), 'full_vocab_correct': int((p==y).sum()), + 'four_choice_correct': int((choice==y).sum()), + 'full_vocab_nll': float(v.mean()), + 'rows': [{'id': key, 'gold_id': int(g), 'greedy_id': int(j), + 'choice_id': int(c), 'nll': float(s)} + for key, g, j, c, s in zip(ids, y, p, choice, v)]} + write_json(out, {'single_lisa_is_ablation_of_joint_checkpoint': len(sites) > 1, + 'candidate_sites': list(sites), 'arms': result}) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + for name in ('source', 'cache', 'trained', 'out'): + p.add_argument('--'+name, type=Path, required=True) + a = p.parse_args() + run(a.source, a.cache, a.trained, a.out) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_effect_audit.py b/crossqkv/lisa_effect_audit.py new file mode 100644 index 0000000..67a9cb2 --- /dev/null +++ b/crossqkv/lisa_effect_audit.py @@ -0,0 +1,98 @@ +"""Independently validate frozen test outputs and report paired capability recovery.""" +import argparse +import hashlib +import json +import math +from pathlib import Path +from statistics import median + +import numpy as np + +from functional.run import write_json + +MODES = ('native', 'direct', 'linear', 'lisa', 'lisa_answer_weighted') + + +def paired(native, direct, candidate): + damaged = native & ~direct + rescued = damaged & candidate + newly_lost = native & direct & ~candidate + candidate_only = ~direct & candidate + direct_only = direct & ~candidate + delta = candidate.astype(int) - direct.astype(int) + rng = np.random.default_rng(415006) + draw = rng.integers(0, len(delta), size=(10000, len(delta))) + ci = np.quantile(delta[draw].mean(1), [.025, .975]) + a, b = int(candidate_only.sum()), int(direct_only.sum()) + k = a + b + p = min(1., 2. * sum(math.comb(k, i) for i in range(min(a, b)+1)) / 2**k) + return {'native_correct_lost_by_direct': int(damaged.sum()), 'rescued': int(rescued.sum()), + 'newly_lost_among_native_and_direct_correct': int(newly_lost.sum()), + 'candidate_correct_direct_wrong': a, 'direct_correct_candidate_wrong': b, + 'accuracy_delta_vs_direct': float(delta.mean()), + 'paired_prompt_bootstrap_95': ci.tolist(), 'mcnemar_exact_p': p} + + +def audit(fixed, selection, items, perf=None, decode=None): + spec = json.loads(selection.read_text()) + if hashlib.sha256(fixed.read_bytes()).hexdigest() != spec['fixed_problems_sha256']: + raise ValueError('Fixed problems provenance mismatch') + problem = json.loads(fixed.read_text()) + task = spec['task'] + expected = [(r['id'], r['answer_index']) for r in problem['test'] if r['task'] == task] + data = json.loads(items.read_text()) + if set(data) != set(MODES) or not expected: + raise ValueError('Unexpected test arms or empty selected split') + correct = {} + mean_losses = {} + for mode, rows in data.items(): + if [(r['id'], r['gold']) for r in rows] != expected: + raise ValueError(f'{mode} result does not match the locked challenge') + logits = np.array([r['logits'] for r in rows]) + gold = np.array([r['gold'] for r in rows]) + pred = np.array([r['pred'] for r in rows]) + nll = np.logaddexp.reduce(logits, 1) - logits[np.arange(len(rows)), gold] + if (logits.shape != (len(rows), 4) or not np.isfinite(logits).all() + or not np.array_equal(logits.argmax(1), pred)): + raise ValueError(f'Invalid choice scores for {mode}') + np.testing.assert_allclose(nll, [row['answer_nll'] for row in rows], atol=3e-6, rtol=2e-6) + correct[mode], mean_losses[mode] = pred == gold, float(nll.mean()) + metrics = {'selected_task': task, 'sites': spec['sites'], 'n': len(expected), + 'arms': {mode: {'correct': int(correct[mode].sum()), 'answer_nll_4': mean_losses[mode], + **paired(correct['native'], correct['direct'], correct[mode])} + for mode in MODES}} + if perf: + measured = json.loads(perf.read_text()) + med = {k: median(v) for k,v in measured['seconds'].items()} + metrics['prefill'] = {'scope': measured['scope'], 'median_s': med, + 'lisa_median_ratio_to_native': med['lisa']/med['native']} + if decode: + measured = json.loads(decode.read_text()) + metrics['decode'] = {'scope': measured['scope'], 'sites': {}} + for layer, raw in measured['sites'].items(): + times = {k: median(v) for k,v in raw['seconds_per_token'].items()} + mem = raw['allocated_bytes'] + native = mem['native']['k'] + mem['native']['v'] + lisa = mem['lisa']['k'] + mem['lisa']['v'] + nn = raw['lisa_input_score_row_bytes'] + assert mem['lisa']['v'] == mem['native']['v'] and mem['lisa']['k'] < mem['native']['k'] + metrics['decode']['sites'][layer] = { + 'median_s_per_token': times, 'measured_kv_bytes': {'native': native, 'lisa': lisa}, + 'lisa_upstream_score_row_bytes': nn, 'recipient_bytes_delta': lisa+nn-native, + } + return metrics + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + for name in ('fixed', 'selection', 'items', 'out'): + parser.add_argument('--'+name, type=Path, required=True) + parser.add_argument('--perf', type=Path) + parser.add_argument('--decode', type=Path) + a = parser.parse_args() + report = audit(a.fixed, a.selection, a.items, a.perf, a.decode) + write_json(a.out, report) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_effect_screen.py b/crossqkv/lisa_effect_screen.py new file mode 100644 index 0000000..9ef9912 --- /dev/null +++ b/crossqkv/lisa_effect_screen.py @@ -0,0 +1,183 @@ +"""Screen task difficulty and joint sharing schedules without opening test results.""" +import argparse +import json +import random +from pathlib import Path + +import numpy as np +from tokenizers import Tokenizer + +from crossqkv.core import QKVModel +from crossqkv.lisa_pilot import batch +from functional.model import PREFIX +from functional.run import write_json +from pilot.tensors import decode + +MODES = ('native', 'direct_23', 'direct_19_23') +SITES = (15, 19, 23) +TASKS = ('lookup8', 'lookup16', 'latest8', 'arithmetic') +SPLIT_SEEDS = {'screen': 415001, 'fit': 415002, 'validation': 415003, 'test': 415004} +WORDS = ('amber birch cedar dune elm fern grove heath iris jade kelp larch ' + 'maple nettle olive pine quartz reed slate thyme umber vine willow yew').split() + + +def problems(split, per_task): + rng = random.Random(SPLIT_SEEDS[split]) + rows = [] + for task in TASKS: + answers = [i % 4 for i in range(per_task)] + rng.shuffle(answers) + for i, answer in enumerate(answers): + if task == 'arithmetic': + a, b = rng.sample(range(12, 99), 2) + target = a + b + distractors = [target - 10, target + 10, target + rng.choice((-1, 1))] + question = f'What is {a} + {b}?' + else: + size = 16 if task == 'lookup16' else 8 + keys, vals = rng.sample(WORDS, size), rng.sample(range(10, 100), size) + if task == 'latest8': + first = rng.randrange(size - 1) + last = rng.randrange(first + 1, size) + keys[last] = keys[first] + target = vals[last] + remaining = [v for j, v in enumerate(vals) if j not in (first, last)] + distractors = [vals[first], *rng.sample(remaining, 2)] + key = keys[first] + else: + match = rng.randrange(size) + target, key = vals[match], keys[match] + distractors = rng.sample([v for v in vals if v != target], 3) + table = '\n'.join(f'{k}: {v}' for k, v in zip(keys, vals)) + request = 'latest value' if task == 'latest8' else 'value' + order = ' (oldest first)' if task == 'latest8' else '' + question = f'Use the lookup table{order}.\n{table}\nWhich option is the {request} for {key}?' + rng.shuffle(distractors) + distractors.insert(answer, target) + options = '\n'.join(f'{j+1}. {v}' for j, v in enumerate(distractors)) + prompt = f'{question}\n{options}\nAnswer with only the option number.\nAnswer:' + rows.append({'id': f'{split}-{task}-{i:03}', 'task': task, + 'prompt': prompt, 'answer_index': answer}) + return rows + + +class ScreeningModel(QKVModel): + def normalization(self, h, name): + if getattr(self, 'capture_prefix', False) and name == 'layers.19.input_layernorm': + self.residual_19 = h + return super().normalization(h, name) + + def full_attention(self, h, layer, shared_p=None): + if layer not in SITES: + return super().full_attention(h, layer, shared_p) + own = self.parts(h, layer, heads=False) + p = own['p'].copy() + if getattr(self, 'capture_prefix', False): + if layer == 15: + self.donor_15 = p + return own['output'], p + if layer == 19: + p[self.chain] = self.prior[self.chain] + elif layer == 23: + p[self.shared] = self.prior[self.shared] + self.prior = p + repeats = self.config['num_attention_heads'] // self.config['num_key_value_heads'] + v = np.repeat(own['v'], repeats, axis=2) + out = self.project(np.einsum('bhts,bshd->bthd', p, v), own['gate'], layer) + return out, p + + +def evaluate(model, tokenizer, examples): + ids, lengths, labels = batch(tokenizer, examples) + n = len(examples) + model.chain = slice(2*n, 3*n) + model.shared = slice(n, 3*n) + if not getattr(model, 'reuse_prefix', False): + h, _ = model.forward(np.tile(ids, (len(MODES), 1))) + else: + model.capture_prefix = True + native, _ = model.forward(ids) + model.capture_prefix = False + h = np.concatenate([model.residual_19] * len(MODES)) + model.prior = np.concatenate([model.donor_15] * len(MODES)) + for layer, kind in enumerate(model.config['layer_types'][19:], 19): + model.guard() + p = f'layers.{layer}.' + n_h = model.normalization(h, p+'input_layernorm') + out = (model.full_attention(n_h, layer)[0] if kind == 'full_attention' + else model.linear_attention(n_h, layer)) + h = h + out + h = h + model.mlp(model.normalization(h, p+'post_attention_layernorm'), layer) + h = model.normalization(h, 'norm') + np.testing.assert_allclose(h[:n], native, atol=4e-5, rtol=3e-5) + t = model.tensors[PREFIX + 'embed_tokens.weight'] + digit_weights = decode(t.raw.reshape(t.shape)[labels], t.dtype) + t.evict() + scores = [x[np.arange(n), np.asarray(lengths) - 1] @ digit_weights.T + for x in np.split(h, len(MODES))] + rows = [] + for i, ex in enumerate(examples): + gold = ex['answer_index'] + item = {'id': ex['id'], 'task': ex['task'], 'gold': gold, 'scores': {}} + for mode, logits in zip(MODES, scores): + values = logits[i].astype(float) + item['scores'][mode] = {'pred': int(values.argmax()), 'logits': values.tolist(), + 'nll': float(np.logaddexp.reduce(values) - values[gold])} + rows.append(item) + return rows + + +def summarize(rows): + table = {} + for task in TASKS: + group = [r for r in rows if r['task'] == task] + if not group: + continue + table[task] = {} + for mode in MODES: + table[task][mode] = { + 'n': len(group), + 'correct': sum(r['scores'][mode]['pred'] == r['gold'] for r in group), + 'native_wins_lost': sum(r['scores']['native']['pred'] == r['gold'] + and r['scores'][mode]['pred'] != r['gold'] for r in group), + 'nll': float(np.mean([r['scores'][mode]['nll'] for r in group])), + } + return table + + +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('--resume', action='store_true', help='Keep completed batches') + parser.add_argument('--reuse-prefix', action='store_true', help='Run layers 0–18 once per input') + args = parser.parse_args() + args.out.mkdir(exist_ok=args.resume) + model = ScreeningModel(args.source/'weights', + json.loads((args.source/'model_config.json').read_text()), seconds=3600) + if any(model.config['layer_types'][ix] != 'full_attention' for ix in SITES): + raise ValueError('Scheduled layers must all have full attention') + model.reuse_prefix = args.reuse_prefix + tok = Tokenizer.from_file(str(args.source/'tokenizer.json')) + data = {split: problems(split, n) for split, n in + [('screen', 8), ('fit', 12), ('validation', 12), ('test', 32)]} + prompts = [r['prompt'] for xs in data.values() for r in xs] + if len(set(prompts)) != len(prompts): + raise ValueError('Prompt sets overlap') + manifest = args.out/'fixed-problems.json' + collected = args.out/'screen-rows.json' + if args.resume and manifest.exists() and json.loads(manifest.read_text()) != data: + raise ValueError('Fixed prompts changed') + write_json(manifest, data) + rows = json.loads(collected.read_text()) if args.resume and collected.exists() else [] + if len(rows) % 4 or [r['id'] for r in rows] != [r['id'] for r in data['screen'][:len(rows)]]: + raise ValueError('Existing screen does not match the fixed prompt sequence') + for i in range(len(rows), len(data['screen']), 4): + rows.extend(evaluate(model, tok, data['screen'][i:i+4])) + write_json(args.out/'screen-rows.json', rows) + print('screen', len(rows), flush=True) + write_json(args.out/'screen-summary.json', summarize(rows)) + + +if __name__ == '__main__': + main() diff --git a/crossqkv/lisa_tail.py b/crossqkv/lisa_tail.py new file mode 100644 index 0000000..3b097d5 --- /dev/null +++ b/crossqkv/lisa_tail.py @@ -0,0 +1,173 @@ +"""Differentiable Qwen text tail with streamed frozen weights and LiSA sites.""" +import math + +import torch +from torch import nn +from torch.nn import functional as F +from torch.utils.checkpoint import checkpoint + +from crossqkv.lisa_train import causal_attention +from functional.model import PREFIX + + +def weight_chunks(tensor, start, end, rows=512): + width = tensor.shape[1] + for lo in range(start, end, rows): + hi = min(lo + rows, end) + yield torch.from_numpy(tensor.read(slice(lo * width, hi * width)).reshape(hi-lo, width)) + tensor.evict() + + +class FrozenLinear(torch.autograd.Function): + """Read only the requested output rows and stream them again for dX.""" + + @staticmethod + def forward(ctx, hidden, weight, start, end): + ctx.weight, ctx.start, ctx.end = weight, start, end + return torch.cat([F.linear(hidden, w) for w in weight_chunks(weight, start, end)], dim=-1) + + @staticmethod + def backward(ctx, grad): + out = grad.new_zeros((*grad.shape[:-1], ctx.weight.shape[1])) + lo = 0 + for w in weight_chunks(ctx.weight, ctx.start, ctx.end): + hi = lo + len(w) + out = out + grad[..., lo:hi] @ w + lo = hi + return out, None, None, None + + +def rotate(x, theta, fraction): + 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, :] + 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): + 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]) + rows = [] + for i in range(v.shape[1]): + qt, kt, vt = q[:, i], k[:, i], v[:, i] + state = state * g[:, i, :, None, None].exp() + 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) + + +class TorchTail(nn.Module): + """Inputs start immediately before the first trainable recipient.""" + + def __init__(self, source_model, start, adapters=None): + super().__init__() + self.source = source_model + self.c = source_model.config + self.eps = source_model.eps + self.start = start + self.adapters = nn.ModuleDict({str(k): v for k, v in (adapters or {}).items()}) + self._small = {} + + def small(self, name): + if name not in self._small: + self._small[name] = torch.from_numpy(self.source.small(name)) + return self._small[name] + + def linear(self, h, name, start=0, end=None): + t = self.source.tensors[PREFIX + name + '.weight'] + return FrozenLinear.apply(h, t, start, t.shape[0] if end is None else end) + + def norm(self, x, name, centered=True): + w = self.small(name + '.weight') + return x * (x.square().mean(-1, keepdim=True) + self.eps).rsqrt() * (1+w if centered else w) + + def gate_only(self, h, name): + heads, dim = self.c['num_attention_heads'], self.c['head_dim'] + return torch.stack([self.linear(h, name+'q_proj', (2*j+1)*dim, (2*j+2)*dim) + for j in range(heads)], dim=2) + + def native_scores(self, q, h, name): + c = self.c + k = self.linear(h, name+'k_proj').unflatten(-1, (c['num_key_value_heads'], c['head_dim'])) + params = c['rope_parameters'] + q = rotate(self.norm(q, name+'q_norm'), params['rope_theta'], params['partial_rotary_factor']) + k = rotate(self.norm(k, name+'k_norm'), params['rope_theta'], params['partial_rotary_factor']) + k = k.repeat_interleave(q.shape[2] // k.shape[2], dim=2) + return torch.einsum('bthd,bshd->bhts', q, k) / math.sqrt(q.shape[-1]) + + def full(self, h, layer, donor, lengths, mode, recipients, keep_teacher): + c = self.c + heads, kv_heads, dim = c['num_attention_heads'], c['num_key_value_heads'], c['head_dim'] + name = f'layers.{layer}.self_attn.' + shared = layer in recipients and mode != 'native' + if not shared or keep_teacher: + packed = self.linear(h, name+'q_proj').unflatten(-1, (heads, 2*dim)) + q, gate = packed.chunk(2, dim=-1) + if shared: + with torch.no_grad(): + native = self.native_scores(q, h, name) + else: + native = self.native_scores(q, h, name) + else: + gate = self.gate_only(h, name) + native = None + if not shared: + scores = native + elif mode == 'direct': + scores = donor + elif mode == 'lisa': + pos = torch.arange(h.shape[1], device=h.device)[None, :] + scores = self.adapters[str(layer)](h, donor, pos) + elif mode == 'linear': + matrix = self.adapters[str(layer)] + scores = matrix(donor.permute(0, 2, 3, 1)).permute(0, 3, 1, 2) + else: + raise ValueError(f'Unknown mode {mode}') + v = self.linear(h, name+'v_proj').unflatten(-1, (kv_heads, dim)) + out = causal_attention(scores, v, lengths) * gate.sigmoid() + return self.linear(out.flatten(-2), name+'o_proj'), scores, native + + def linear_attention(self, x, layer): + 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]] + 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) + v = v.unflatten(-1, (vh, vd)) + gate = self.linear(x, p+'in_proj_z').unflatten(-1, (vh, vd)) + 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') + + def forward(self, h, donor, lengths, mode, recipients, keep_teacher=False): + side = {} + for layer, kind in enumerate(self.c['layer_types'][self.start:], self.start): + p = f'layers.{layer}.' + n = self.norm(h, p+'input_layernorm') + if kind == 'full_attention': + out, donor, native = self.full(n, layer, donor, lengths, mode, recipients, + keep_teacher) + side[layer] = (donor, native) + elif torch.is_grad_enabled() and n.requires_grad: + out = checkpoint(self.linear_attention, n, layer, use_reentrant=True) + else: + out = self.linear_attention(n, layer) + h = h + out + n = self.norm(h, p+'post_attention_layernorm') + x = F.silu(self.linear(n, p+'mlp.gate_proj')) * self.linear(n, p+'mlp.up_proj') + h = h + self.linear(x, p+'mlp.down_proj') + return self.norm(h, 'norm'), side diff --git a/crossqkv/lisa_train.py b/crossqkv/lisa_train.py index b57031b..2b0ff3b 100644 --- a/crossqkv/lisa_train.py +++ b/crossqkv/lisa_train.py @@ -90,7 +90,7 @@ class _FrozenVocabularyCE(torch.autograd.Function): """Exact full-vocabulary CE with a streamed frozen head in both passes.""" @staticmethod - def forward(ctx, hidden, targets, vocabulary): + def forward(ctx, hidden, targets, weights, vocabulary): log_total = hidden.new_full((hidden.shape[0],), -torch.inf) selected = hidden.new_zeros(hidden.shape[0]) for start, w in vocabulary(): @@ -98,24 +98,26 @@ class _FrozenVocabularyCE(torch.autograd.Function): log_total = torch.logaddexp(log_total, logits.logsumexp(dim=-1)) belongs = (targets >= start) & (targets < start + w.shape[0]) selected[belongs] = logits[belongs, targets[belongs] - start] - ctx.save_for_backward(hidden, targets, log_total) + ctx.save_for_backward(hidden, targets, log_total, weights) ctx.vocabulary = vocabulary - return (log_total - selected).mean() + return ((log_total - selected) * weights).sum() / weights.sum() @staticmethod def backward(ctx, gradient): - hidden, targets, log_total = ctx.saved_tensors + hidden, targets, log_total, weights = ctx.saved_tensors grad_hidden = torch.zeros_like(hidden) for start, w in ctx.vocabulary(): probs = (F.linear(hidden, w) - log_total[:, None]).exp() belongs = (targets >= start) & (targets < start + w.shape[0]) probs[belongs, targets[belongs] - start] -= 1 grad_hidden.addmm_(probs, w) - return grad_hidden * (gradient / hidden.shape[0]), None, None + return grad_hidden * (gradient * weights[:, None] / weights.sum()), None, None, None -def language_model_loss(hidden, ids, lengths, vocabulary): +def language_model_loss(hidden, ids, lengths, vocabulary, answer_weight=1.0): """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] - return _FrozenVocabularyCE.apply(hidden[:, :-1][valid], ids[:, 1:][valid], vocabulary) + 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_EFFECT_PROTOCOL.md b/docs/LISA_EFFECT_PROTOCOL.md new file mode 100644 index 0000000..7765511 --- /dev/null +++ b/docs/LISA_EFFECT_PROTOCOL.md @@ -0,0 +1,151 @@ +# LiSA effect reproduction on Qwen3.5-2B + +The earlier single-layer training verified the method but used an evaluation +where the frozen 2B model answered only one of sixteen items. This protocol +measures retention of an existing capability and the cost of exercising it. + +## Comparison with the published experiment + +The 96.44% in Table 2 is the average performance retained by LLaMA2-13B +with 22 recipient layers across the reported benchmarks excluding LAMBADA. +At the same 22 layers, direct score sharing retained 46.76% and the direct +sharing plus LoRA baseline retained 65.95%. The published main uptraining +used 4.2 billion sampled RedPajama tokens on eight A800 GPUs. This experiment +uses a frozen Qwen3.5-2B backbone, two recipient layers, 12 synthetic fit +prompts and a single CPU runner. The comparable effect is an improvement +over direct sharing under a fixed layer schedule. The magnitude on a +32-item lookup test and the timing of CPU attention should be interpreted +within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf) + +## Task and layer screening + +All four tasks, answer-position balances, and generators are fixed in +`crossqkv/lisa_effect_screen.py`. The screening split is used only for +selecting a primary task family and the schedule. Fit, validation, and test +prompts have disjoint fixed seeds. The screen must finish before opening +test metrics. + +Test original attention, 19→23 direct reuse, and a chained 15→19→23 +configuration, with each donor providing its actual scores in the current +run. Primary eligibility on the development screen requires original accuracy +at least 5/8 and at least one original-correct item lost under shared +attention. Compare candidate schedules by the count of native-correct items +lost, preferring the two-receiver schedule among ties and recording net +accuracy and four-option NLL. If none qualify, retain the screen and expand +development coverage before choosing a new task; never pick based on test +errors. The fixed test also reports all outcomes on the chosen task, including +native-incorrect items. + +## Performance comparison + +Compare native, direct, fit-only linear calibration and trainable LiSA on +identical prompts. Preserve Qwen recipient gates, V, and output projection. +Compare the published 0.25 Huber and 0.75 next-token CE objective with an +explicit answer-weighted variant. All adaptation and model selection use +only fit/validation. Record the whole-sequence training loss. On held-out prompts, report +answer-only loss, correctly recovered and newly lost questions, net +accuracy, and performance at one and two recipients. A measured failure to recover is a valid outcome. + +For speed, use a path that actually skips dense Q/K at shared sites, keeping +gate rows. Verify against a reference first. With identical prompts, +checkpoint and runner, report measured latency for the implemented prefill +or decode path and its true scope. Account for both the reduced K storage +and additional score tensors. Do not call analytical estimates measured +speed or apply paper throughput figures to this CPU implementation. + +The incremental recipient benchmark uses actual K/V buffers and compares the +shared implementation with native attention at the same prefix length and FP32 +storage format. Numerical tests compare incremental scores and outputs with +batched causal attention at every query position. Report observed allocation +for K/V and the donor score row separately from end-to-end prefill or decode. +It does not include upstream score generation or the rest of the decoder. + +```sh +python -B -m crossqkv.lisa_decode_bench --source runs/cpu-qwen35-2b \ + --capture runs/LISA_EFFECT_CAPTURE --checkpoint runs/LISA_EFFECT_RESULTS/lisa.pt \ + --out runs/LISA_EFFECT_RESULTS/decode.json +``` + +An interrupted development screen can resume with the same fixed prompt set +using `--resume`. Use `--reuse-prefix` to compute the frozen prefix once per +prompt. The replay checks original-mode parity before accepting results. + +## Recorded development selection + +The fixed screen completed with 32 prompts. The prespecified eligibility rule +selected the 16-entry lookup task with recipients at layers 19 and 23. Native +and one-recipient direct sharing each scored 8/8. Two-recipient direct sharing +scored 7/8 and lost one native-correct answer. The selected configuration, +all screened logits, and the disjoint prompt manifest are archived under +`results/lisa-effect-reproduction/`. This was selection evidence only. + +The held-out analysis records rescue of native-correct errors, newly introduced +errors, paired uncertainty and answer NLL. A second pass streams the complete +vocabulary at the same answer positions and compares one- and two-recipient +forward paths. In the one-recipient LiSA ablation the final adapter comes from +the joint checkpoint. It is evaluated unchanged, with the earlier recipient +restored to native attention. + +Training also saves each finished epoch's adapter, AdamW state, validation +history and selected weights atomically per variant. For interrupted training, +re-run the same command with `--resume` and the same output directory and epoch +budget. Resume verifies the frozen training configuration, preserves finished +epochs and re-scores the locked test set from the validation-selected weights. +The separate selected checkpoints retain the original weights-only schema. + +The development error was `screen-lookup16-005`. Its correct choice was +option 4. Across native, single-recipient direct reuse and chained direct reuse, +the four-choice probability of option 4 was 0.706, 0.815 and 0.403, +respectively. Its correct-versus-best-distractor logit margins were ++1.265, +1.861 and −0.258. The chained result chose option 2. These are +development observations that describe the selected condition, not test +results or a basis for changing the frozen prompts. + +## Reproduction commands + +Run from the project code root on the confirmed remote CPU environment. +Choose new output directories. Keep the same source checkpoint across all +commands. The fixed manifest contains all four split definitions, and capture +writes an independent selection record and source fingerprints. + +```sh +export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 +PYTHON=venv/bin/python +SOURCE=runs/cpu-qwen35-2b +SCREEN=runs/NEW_EFFECT_SCREEN +CAPTURE=runs/NEW_EFFECT_CAPTURE +RESULT=runs/NEW_EFFECT_RESULT + +"$PYTHON" -B -m crossqkv.lisa_effect_screen --source "$SOURCE" --out "$SCREEN" --reuse-prefix +"$PYTHON" -B -m crossqkv.lisa_effect capture --source "$SOURCE" --input "$SCREEN" --out "$CAPTURE" +"$PYTHON" -B -m crossqkv.lisa_effect train --source "$SOURCE" --input "$CAPTURE" --out "$RESULT" --epochs 2 +"$PYTHON" -B -m crossqkv.lisa_decode_bench --source "$SOURCE" --capture "$CAPTURE" \ + --checkpoint "$RESULT/lisa.pt" --out "$RESULT/decode.json" +"$PYTHON" -B -m crossqkv.lisa_effect_answer_audit --source "$SOURCE" --cache "$CAPTURE" \ + --trained "$RESULT" --out "$RESULT/full-vocab-answers.json" +"$PYTHON" -B -m crossqkv.lisa_effect_audit --fixed "$SCREEN/fixed-problems.json" \ + --selection "$CAPTURE/selection.json" --items "$RESULT/test-items.json" \ + --perf "$RESULT/performance.json" --decode "$RESULT/decode.json" --out "$RESULT/paired-audit.json" +``` + +The paired audit defines a rescue as a native-correct item made wrong by +direct sharing and made correct again by the tested adapter. It reports +newly lost native-and-direct-correct items separately. An improvement in +mean four-option answer NLL, including among items already answered +correctly, does not by itself establish a rescue. + +Training scores *all* valid shifted tokens with exact full-vocabulary CE +and uses the validation four-option answer loss to freeze checkpoints. The +answer audit scores only the answer position over the whole vocabulary. +It does not report whole-prompt CE for the held-out items or free-form +multi-token answer accuracy. That distinction is important for interpreting +the previous experiment, in which those two losses moved in opposite +directions. + +For the isolated incremental attention timing, report both streamed +checkpoint projections and an otherwise identical timing with only that +site's frozen projections resident in memory. Verify output and raw score +parity before interpreting the pair of timings. The resident measurements +exclude weight-load time, and both timings exclude upstream computation and +other decoder blocks. K/V and upstream score-row allocation are itemized +separately; neither timing is an end-to-end server throughput claim. diff --git a/results/lisa-effect-reproduction/development-native-reference.json b/results/lisa-effect-reproduction/development-native-reference.json new file mode 100644 index 0000000..1ccecd6 --- /dev/null +++ b/results/lisa-effect-reproduction/development-native-reference.json @@ -0,0 +1,10 @@ +{ + "task": "lookup16", + "source": "frozen Qwen3.5-2B hidden states at the answer position from native forward", + "metric": "4-option accuracy and mean NLL over four option logits", + "frozen_native_reference": { + "fit": {"samples": 12, "native_correct": 12, "choice_nll": 0.13035377124382475}, + "validation": {"samples": 12, "native_correct": 12, "choice_nll": 0.13171539331834095} + }, + "test_predictions_opened": false +} diff --git a/results/lisa-effect-reproduction/fixed-problems.json b/results/lisa-effect-reproduction/fixed-problems.json new file mode 100644 index 0000000..08bbeb1 --- /dev/null +++ b/results/lisa-effect-reproduction/fixed-problems.json @@ -0,0 +1,1546 @@ +{ + "screen": [ + { + "id": "screen-lookup8-000", + "task": "lookup8", + "prompt": "Use the lookup table.\nyew: 51\namber: 99\nbirch: 38\nwillow: 45\nslate: 42\number: 12\nquartz: 18\nmaple: 36\nWhich option is the value for quartz?\n1. 18\n2. 36\n3. 45\n4. 38\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-lookup8-001", + "task": "lookup8", + "prompt": "Use the lookup table.\namber: 99\nlarch: 70\nyew: 82\ndune: 44\njade: 32\nquartz: 77\nbirch: 23\nthyme: 54\nWhich option is the value for yew?\n1. 23\n2. 82\n3. 70\n4. 54\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-lookup8-002", + "task": "lookup8", + "prompt": "Use the lookup table.\nyew: 50\nlarch: 47\nnettle: 31\nslate: 60\nelm: 39\ncedar: 80\nfern: 82\number: 49\nWhich option is the value for larch?\n1. 50\n2. 80\n3. 47\n4. 82\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-lookup8-003", + "task": "lookup8", + "prompt": "Use the lookup table.\nnettle: 48\nheath: 44\nbirch: 72\npine: 40\ngrove: 65\nyew: 75\nwillow: 70\nmaple: 83\nWhich option is the value for yew?\n1. 72\n2. 44\n3. 75\n4. 40\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-lookup8-004", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 16\nlarch: 60\nreed: 68\nbirch: 37\njade: 14\number: 61\nmaple: 40\ndune: 62\nWhich option is the value for dune?\n1. 61\n2. 62\n3. 14\n4. 68\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-lookup8-005", + "task": "lookup8", + "prompt": "Use the lookup table.\nlarch: 10\namber: 85\njade: 62\npine: 14\nolive: 94\nquartz: 37\nvine: 53\nbirch: 40\nWhich option is the value for jade?\n1. 37\n2. 94\n3. 40\n4. 62\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-lookup8-006", + "task": "lookup8", + "prompt": "Use the lookup table.\namber: 86\nkelp: 23\njade: 72\nnettle: 60\nyew: 18\nthyme: 13\nslate: 29\number: 38\nWhich option is the value for nettle?\n1. 72\n2. 29\n3. 38\n4. 60\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-lookup8-007", + "task": "lookup8", + "prompt": "Use the lookup table.\npine: 27\nkelp: 99\nreed: 41\nthyme: 34\number: 49\namber: 71\nlarch: 76\nelm: 77\nWhich option is the value for reed?\n1. 41\n2. 49\n3. 99\n4. 27\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-lookup16-000", + "task": "lookup16", + "prompt": "Use the lookup table.\nelm: 66\ndune: 90\nbirch: 53\nheath: 92\ncedar: 64\nnettle: 21\nthyme: 57\nyew: 63\nkelp: 13\nreed: 52\nvine: 93\nlarch: 76\nslate: 24\number: 89\nmaple: 94\npine: 48\nWhich option is the value for vine?\n1. 21\n2. 57\n3. 13\n4. 93\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-lookup16-001", + "task": "lookup16", + "prompt": "Use the lookup table.\nolive: 47\nbirch: 52\nkelp: 19\nfern: 55\nelm: 38\ngrove: 11\nslate: 84\njade: 77\nquartz: 58\nthyme: 56\nlarch: 87\number: 51\nreed: 96\npine: 67\nyew: 99\nmaple: 43\nWhich option is the value for jade?\n1. 77\n2. 96\n3. 55\n4. 51\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-lookup16-002", + "task": "lookup16", + "prompt": "Use the lookup table.\nvine: 85\nmaple: 95\nbirch: 46\nwillow: 18\nlarch: 70\nslate: 75\nquartz: 83\number: 90\nelm: 30\nolive: 61\nfern: 43\nkelp: 36\ngrove: 39\nyew: 60\npine: 78\njade: 29\nWhich option is the value for umber?\n1. 46\n2. 90\n3. 29\n4. 83\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-lookup16-003", + "task": "lookup16", + "prompt": "Use the lookup table.\namber: 12\nbirch: 34\nolive: 84\nlarch: 79\njade: 21\nslate: 68\nkelp: 19\nvine: 73\nmaple: 65\number: 64\npine: 50\nheath: 94\nthyme: 47\ncedar: 55\nquartz: 49\nelm: 51\nWhich option is the value for amber?\n1. 12\n2. 34\n3. 64\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-lookup16-004", + "task": "lookup16", + "prompt": "Use the lookup table.\nreed: 64\number: 47\ndune: 24\nelm: 79\npine: 91\nvine: 88\ncedar: 25\namber: 81\nolive: 18\nlarch: 72\nwillow: 14\nheath: 30\nnettle: 34\nbirch: 92\nquartz: 67\nthyme: 83\nWhich option is the value for elm?\n1. 92\n2. 79\n3. 72\n4. 67\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-lookup16-005", + "task": "lookup16", + "prompt": "Use the lookup table.\nkelp: 93\ngrove: 91\number: 11\nyew: 15\niris: 80\ncedar: 31\nlarch: 55\nnettle: 71\namber: 87\nthyme: 22\ndune: 41\njade: 63\nolive: 90\nquartz: 92\nfern: 54\nbirch: 72\nWhich option is the value for grove?\n1. 55\n2. 15\n3. 41\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-lookup16-006", + "task": "lookup16", + "prompt": "Use the lookup table.\ncedar: 70\nkelp: 76\nnettle: 19\nheath: 73\namber: 55\nvine: 40\nquartz: 23\nreed: 98\nwillow: 20\nfern: 30\nbirch: 39\npine: 78\nlarch: 10\number: 93\ndune: 61\nolive: 50\nWhich option is the value for reed?\n1. 78\n2. 93\n3. 98\n4. 55\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-lookup16-007", + "task": "lookup16", + "prompt": "Use the lookup table.\namber: 77\nwillow: 90\njade: 53\number: 58\nelm: 17\ndune: 52\nfern: 21\nlarch: 46\nnettle: 36\nreed: 71\npine: 62\nheath: 16\nquartz: 98\nthyme: 59\nvine: 78\nolive: 85\nWhich option is the value for jade?\n1. 77\n2. 98\n3. 53\n4. 90\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-latest8-000", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nvine: 24\njade: 45\nolive: 33\namber: 16\ngrove: 20\nkelp: 14\nbirch: 60\nkelp: 63\nWhich option is the latest value for kelp?\n1. 63\n2. 20\n3. 14\n4. 24\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-latest8-001", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nelm: 33\ndune: 92\nbirch: 26\npine: 71\niris: 82\nheath: 25\nreed: 79\nreed: 74\nWhich option is the latest value for reed?\n1. 79\n2. 33\n3. 74\n4. 71\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-latest8-002", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 58\nlarch: 28\nthyme: 84\nelm: 89\nyew: 83\ndune: 32\nyew: 55\ngrove: 10\nWhich option is the latest value for yew?\n1. 58\n2. 83\n3. 55\n4. 28\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-latest8-003", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ndune: 28\nyew: 22\nnettle: 65\njade: 94\nnettle: 85\nfern: 82\nvine: 88\number: 35\nWhich option is the latest value for nettle?\n1. 65\n2. 85\n3. 28\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-latest8-004", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ndune: 20\nthyme: 91\namber: 61\ncedar: 72\nlarch: 24\nreed: 38\ncedar: 55\nnettle: 82\nWhich option is the latest value for cedar?\n1. 72\n2. 55\n3. 24\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-latest8-005", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nwillow: 37\nmaple: 35\npine: 54\nfern: 27\nreed: 56\nbirch: 57\nbirch: 74\ngrove: 31\nWhich option is the latest value for birch?\n1. 57\n2. 56\n3. 31\n4. 74\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-latest8-006", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ndune: 62\npine: 36\ncedar: 42\number: 25\namber: 61\number: 45\njade: 13\ngrove: 19\nWhich option is the latest value for umber?\n1. 45\n2. 25\n3. 19\n4. 36\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-latest8-007", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nfern: 28\nfern: 95\nolive: 86\nthyme: 90\nelm: 70\nbirch: 64\nreed: 46\nmaple: 84\nWhich option is the latest value for fern?\n1. 90\n2. 28\n3. 46\n4. 95\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-arithmetic-000", + "task": "arithmetic", + "prompt": "What is 44 + 80?\n1. 114\n2. 125\n3. 124\n4. 134\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-arithmetic-001", + "task": "arithmetic", + "prompt": "What is 91 + 38?\n1. 130\n2. 139\n3. 129\n4. 119\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "screen-arithmetic-002", + "task": "arithmetic", + "prompt": "What is 53 + 74?\n1. 117\n2. 127\n3. 137\n4. 126\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-arithmetic-003", + "task": "arithmetic", + "prompt": "What is 20 + 13?\n1. 23\n2. 33\n3. 43\n4. 32\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "screen-arithmetic-004", + "task": "arithmetic", + "prompt": "What is 87 + 95?\n1. 182\n2. 172\n3. 181\n4. 192\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "screen-arithmetic-005", + "task": "arithmetic", + "prompt": "What is 47 + 92?\n1. 140\n2. 149\n3. 129\n4. 139\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-arithmetic-006", + "task": "arithmetic", + "prompt": "What is 19 + 22?\n1. 31\n2. 40\n3. 51\n4. 41\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "screen-arithmetic-007", + "task": "arithmetic", + "prompt": "What is 95 + 22?\n1. 117\n2. 127\n3. 107\n4. 118\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + } + ], + "fit": [ + { + "id": "fit-lookup8-000", + "task": "lookup8", + "prompt": "Use the lookup table.\nkelp: 35\ndune: 16\nthyme: 23\nyew: 51\npine: 41\nbirch: 72\number: 60\nnettle: 47\nWhich option is the value for nettle?\n1. 47\n2. 35\n3. 51\n4. 60\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup8-001", + "task": "lookup8", + "prompt": "Use the lookup table.\namber: 15\njade: 52\ncedar: 67\nreed: 29\nvine: 12\nnettle: 61\npine: 14\nwillow: 44\nWhich option is the value for pine?\n1. 61\n2. 67\n3. 52\n4. 14\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-lookup8-002", + "task": "lookup8", + "prompt": "Use the lookup table.\npine: 45\njade: 86\nolive: 37\nyew: 17\nelm: 83\nbirch: 30\nheath: 95\nslate: 20\nWhich option is the value for olive?\n1. 20\n2. 17\n3. 37\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup8-003", + "task": "lookup8", + "prompt": "Use the lookup table.\npine: 76\nheath: 78\nvine: 35\ndune: 94\ngrove: 97\niris: 88\nelm: 32\nnettle: 98\nWhich option is the value for heath?\n1. 88\n2. 78\n3. 97\n4. 76\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup8-004", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 66\npine: 80\nwillow: 52\number: 85\nbirch: 61\namber: 42\nyew: 56\nfern: 12\nWhich option is the value for pine?\n1. 66\n2. 42\n3. 80\n4. 61\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup8-005", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 99\nmaple: 95\nelm: 94\nslate: 31\number: 68\ncedar: 23\njade: 77\nbirch: 66\nWhich option is the value for birch?\n1. 66\n2. 94\n3. 31\n4. 77\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup8-006", + "task": "lookup8", + "prompt": "Use the lookup table.\npine: 49\nquartz: 23\nvine: 67\ncedar: 88\nthyme: 41\ndune: 44\njade: 81\namber: 89\nWhich option is the value for amber?\n1. 49\n2. 23\n3. 88\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-lookup8-007", + "task": "lookup8", + "prompt": "Use the lookup table.\nyew: 18\number: 77\ncedar: 63\nlarch: 17\ngrove: 89\niris: 76\nmaple: 15\nwillow: 33\nWhich option is the value for iris?\n1. 18\n2. 76\n3. 33\n4. 77\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup8-008", + "task": "lookup8", + "prompt": "Use the lookup table.\nnettle: 14\nslate: 86\ngrove: 74\niris: 78\nwillow: 30\nfern: 55\nreed: 25\nolive: 51\nWhich option is the value for olive?\n1. 25\n2. 78\n3. 74\n4. 51\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-lookup8-009", + "task": "lookup8", + "prompt": "Use the lookup table.\namber: 95\nyew: 65\nolive: 57\nbirch: 22\ngrove: 44\npine: 55\nnettle: 31\nquartz: 70\nWhich option is the value for amber?\n1. 22\n2. 55\n3. 95\n4. 57\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup8-010", + "task": "lookup8", + "prompt": "Use the lookup table.\ndune: 11\nheath: 25\nwillow: 97\nolive: 81\nlarch: 94\ncedar: 23\nvine: 74\npine: 10\nWhich option is the value for heath?\n1. 97\n2. 25\n3. 23\n4. 11\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup8-011", + "task": "lookup8", + "prompt": "Use the lookup table.\nlarch: 61\nquartz: 93\nbirch: 37\nwillow: 10\nkelp: 86\nvine: 64\nmaple: 21\npine: 25\nWhich option is the value for larch?\n1. 61\n2. 10\n3. 93\n4. 25\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup16-000", + "task": "lookup16", + "prompt": "Use the lookup table.\nwillow: 50\nheath: 74\nquartz: 22\njade: 58\nthyme: 60\nvine: 83\ndune: 16\nlarch: 69\niris: 13\nmaple: 97\nolive: 81\nbirch: 34\nreed: 44\nkelp: 42\nnettle: 26\number: 62\nWhich option is the value for umber?\n1. 60\n2. 16\n3. 83\n4. 62\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-lookup16-001", + "task": "lookup16", + "prompt": "Use the lookup table.\nquartz: 16\nwillow: 67\njade: 89\nyew: 11\nnettle: 85\ndune: 40\nlarch: 68\nbirch: 29\npine: 38\ncedar: 69\namber: 41\nheath: 78\nolive: 97\nmaple: 80\nslate: 24\nreed: 56\nWhich option is the value for amber?\n1. 29\n2. 80\n3. 41\n4. 67\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup16-002", + "task": "lookup16", + "prompt": "Use the lookup table.\nheath: 10\nslate: 17\nvine: 65\nreed: 79\njade: 96\nolive: 69\nquartz: 56\nnettle: 62\ncedar: 57\ndune: 23\nmaple: 91\nkelp: 60\number: 82\nfern: 31\nwillow: 66\nyew: 44\nWhich option is the value for dune?\n1. 23\n2. 31\n3. 66\n4. 69\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup16-003", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 81\nthyme: 44\nkelp: 23\nreed: 75\nbirch: 15\njade: 65\niris: 95\nolive: 62\nlarch: 60\nslate: 30\nquartz: 31\npine: 34\nwillow: 54\nnettle: 97\nheath: 56\nfern: 66\nWhich option is the value for kelp?\n1. 60\n2. 56\n3. 23\n4. 30\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup16-004", + "task": "lookup16", + "prompt": "Use the lookup table.\nwillow: 48\nkelp: 17\niris: 75\nfern: 34\nyew: 43\nnettle: 40\nquartz: 77\namber: 16\nvine: 41\nolive: 60\ngrove: 92\nheath: 57\nlarch: 54\nelm: 35\nreed: 82\ncedar: 85\nWhich option is the value for grove?\n1. 43\n2. 85\n3. 75\n4. 92\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-lookup16-005", + "task": "lookup16", + "prompt": "Use the lookup table.\njade: 67\nslate: 97\nelm: 35\number: 14\ngrove: 33\namber: 51\nreed: 18\nwillow: 38\nmaple: 83\ncedar: 43\ndune: 46\nlarch: 22\nheath: 17\nthyme: 45\niris: 61\nbirch: 23\nWhich option is the value for willow?\n1. 97\n2. 38\n3. 46\n4. 35\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup16-006", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 87\nnettle: 59\namber: 44\nfern: 96\nthyme: 85\npine: 26\ndune: 69\nyew: 12\nvine: 79\number: 49\ncedar: 84\njade: 35\nreed: 52\nquartz: 78\nkelp: 32\nelm: 13\nWhich option is the value for vine?\n1. 79\n2. 13\n3. 35\n4. 59\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup16-007", + "task": "lookup16", + "prompt": "Use the lookup table.\nolive: 17\nyew: 49\npine: 15\nheath: 35\nvine: 28\ngrove: 92\nkelp: 88\nbirch: 39\namber: 25\nslate: 91\ndune: 60\nmaple: 72\nquartz: 95\niris: 48\nelm: 34\nnettle: 16\nWhich option is the value for quartz?\n1. 60\n2. 28\n3. 95\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-lookup16-008", + "task": "lookup16", + "prompt": "Use the lookup table.\nvine: 34\niris: 41\ncedar: 52\nwillow: 23\nreed: 50\nmaple: 29\nlarch: 14\nyew: 79\namber: 67\nheath: 16\number: 47\njade: 20\nthyme: 80\nkelp: 24\nbirch: 70\nfern: 94\nWhich option is the value for thyme?\n1. 80\n2. 34\n3. 94\n4. 14\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-lookup16-009", + "task": "lookup16", + "prompt": "Use the lookup table.\nkelp: 15\nwillow: 46\niris: 37\number: 63\nfern: 34\nreed: 77\nnettle: 71\nolive: 84\namber: 51\nelm: 78\njade: 69\ndune: 99\nquartz: 83\ncedar: 43\nheath: 81\nthyme: 61\nWhich option is the value for iris?\n1. 51\n2. 37\n3. 15\n4. 34\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup16-010", + "task": "lookup16", + "prompt": "Use the lookup table.\nelm: 85\nthyme: 49\nwillow: 41\nmaple: 33\npine: 15\niris: 62\nyew: 50\nquartz: 30\ncedar: 63\nfern: 31\njade: 13\nslate: 36\nlarch: 69\ndune: 43\number: 37\nbirch: 17\nWhich option is the value for slate?\n1. 31\n2. 36\n3. 85\n4. 30\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-lookup16-011", + "task": "lookup16", + "prompt": "Use the lookup table.\nreed: 67\nfern: 60\ngrove: 37\nbirch: 75\nnettle: 14\nmaple: 91\nolive: 99\nslate: 61\nelm: 13\nwillow: 54\nlarch: 66\nquartz: 88\ndune: 57\nthyme: 76\npine: 89\nyew: 38\nWhich option is the value for pine?\n1. 38\n2. 99\n3. 57\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-latest8-000", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nmaple: 93\nheath: 77\nreed: 65\nwillow: 73\nvine: 54\nelm: 57\nkelp: 96\nvine: 14\nWhich option is the latest value for vine?\n1. 73\n2. 54\n3. 14\n4. 93\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-latest8-001", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nlarch: 25\ngrove: 24\ndune: 13\nelm: 73\number: 40\nyew: 44\nlarch: 56\nheath: 36\nWhich option is the latest value for larch?\n1. 44\n2. 25\n3. 36\n4. 56\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-latest8-002", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 37\nslate: 14\nquartz: 59\nreed: 80\namber: 51\nquartz: 46\nlarch: 12\njade: 64\nWhich option is the latest value for quartz?\n1. 80\n2. 59\n3. 46\n4. 12\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-latest8-003", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 13\nelm: 37\nbirch: 63\njade: 75\ngrove: 79\nmaple: 16\nquartz: 91\nquartz: 93\nWhich option is the latest value for quartz?\n1. 75\n2. 93\n3. 91\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-latest8-004", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nelm: 10\number: 79\nheath: 80\nnettle: 43\nelm: 37\npine: 38\nthyme: 73\ncedar: 13\nWhich option is the latest value for elm?\n1. 38\n2. 13\n3. 10\n4. 37\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-latest8-005", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nelm: 55\nolive: 67\namber: 31\nmaple: 65\npine: 48\nmaple: 93\nfern: 68\ngrove: 45\nWhich option is the latest value for maple?\n1. 45\n2. 93\n3. 31\n4. 65\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-latest8-006", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 22\nolive: 87\nkelp: 94\nheath: 70\ngrove: 16\nwillow: 61\number: 92\number: 13\nWhich option is the latest value for umber?\n1. 70\n2. 94\n3. 92\n4. 13\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-latest8-007", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nthyme: 94\number: 21\ndune: 19\nheath: 55\niris: 95\nheath: 14\nquartz: 18\nolive: 48\nWhich option is the latest value for heath?\n1. 14\n2. 19\n3. 55\n4. 48\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-latest8-008", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nheath: 66\nquartz: 43\nlarch: 76\ngrove: 25\nbirch: 27\nolive: 95\ngrove: 87\nkelp: 29\nWhich option is the latest value for grove?\n1. 87\n2. 27\n3. 29\n4. 25\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-latest8-009", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\njade: 92\ndune: 33\nquartz: 24\namber: 74\number: 73\nthyme: 79\npine: 78\nthyme: 86\nWhich option is the latest value for thyme?\n1. 86\n2. 92\n3. 79\n4. 24\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-latest8-010", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nmaple: 29\nolive: 53\nnettle: 46\nfern: 16\ncedar: 33\nbirch: 50\ncedar: 31\njade: 81\nWhich option is the latest value for cedar?\n1. 16\n2. 31\n3. 33\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-latest8-011", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nelm: 12\nlarch: 42\nvine: 20\ngrove: 44\nbirch: 43\number: 52\niris: 33\ngrove: 53\nWhich option is the latest value for grove?\n1. 20\n2. 33\n3. 53\n4. 44\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-arithmetic-000", + "task": "arithmetic", + "prompt": "What is 48 + 76?\n1. 134\n2. 125\n3. 114\n4. 124\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-arithmetic-001", + "task": "arithmetic", + "prompt": "What is 67 + 86?\n1. 154\n2. 153\n3. 143\n4. 163\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-arithmetic-002", + "task": "arithmetic", + "prompt": "What is 13 + 39?\n1. 52\n2. 62\n3. 53\n4. 42\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-arithmetic-003", + "task": "arithmetic", + "prompt": "What is 34 + 55?\n1. 99\n2. 88\n3. 89\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-arithmetic-004", + "task": "arithmetic", + "prompt": "What is 16 + 63?\n1. 78\n2. 69\n3. 89\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-arithmetic-005", + "task": "arithmetic", + "prompt": "What is 68 + 40?\n1. 98\n2. 118\n3. 108\n4. 107\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-arithmetic-006", + "task": "arithmetic", + "prompt": "What is 64 + 29?\n1. 94\n2. 93\n3. 103\n4. 83\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "fit-arithmetic-007", + "task": "arithmetic", + "prompt": "What is 60 + 26?\n1. 86\n2. 87\n3. 76\n4. 96\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-arithmetic-008", + "task": "arithmetic", + "prompt": "What is 66 + 70?\n1. 146\n2. 137\n3. 136\n4. 126\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "fit-arithmetic-009", + "task": "arithmetic", + "prompt": "What is 35 + 30?\n1. 65\n2. 64\n3. 75\n4. 55\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "fit-arithmetic-010", + "task": "arithmetic", + "prompt": "What is 13 + 47?\n1. 50\n2. 61\n3. 70\n4. 60\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "fit-arithmetic-011", + "task": "arithmetic", + "prompt": "What is 90 + 64?\n1. 144\n2. 154\n3. 155\n4. 164\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + } + ], + "validation": [ + { + "id": "validation-lookup8-000", + "task": "lookup8", + "prompt": "Use the lookup table.\nelm: 89\nolive: 35\ndune: 45\nfern: 92\niris: 71\nbirch: 20\number: 95\namber: 26\nWhich option is the value for elm?\n1. 26\n2. 92\n3. 89\n4. 71\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup8-001", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 91\nthyme: 95\nolive: 58\nfern: 12\nlarch: 47\njade: 53\nbirch: 73\nheath: 49\nWhich option is the value for fern?\n1. 12\n2. 53\n3. 91\n4. 47\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-lookup8-002", + "task": "lookup8", + "prompt": "Use the lookup table.\nelm: 43\nheath: 82\nnettle: 66\nfern: 24\njade: 57\namber: 74\nolive: 54\nbirch: 12\nWhich option is the value for jade?\n1. 74\n2. 57\n3. 66\n4. 12\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup8-003", + "task": "lookup8", + "prompt": "Use the lookup table.\ncedar: 93\nslate: 23\nmaple: 13\nyew: 43\njade: 17\nnettle: 86\nlarch: 39\nkelp: 31\nWhich option is the value for jade?\n1. 93\n2. 13\n3. 17\n4. 31\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup8-004", + "task": "lookup8", + "prompt": "Use the lookup table.\nkelp: 56\nheath: 42\nthyme: 61\nolive: 92\nslate: 21\nelm: 20\ncedar: 95\nreed: 62\nWhich option is the value for heath?\n1. 56\n2. 42\n3. 92\n4. 62\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup8-005", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 68\njade: 93\number: 10\nmaple: 71\nlarch: 70\nheath: 79\nslate: 60\ndune: 31\nWhich option is the value for maple?\n1. 60\n2. 93\n3. 31\n4. 71\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup8-006", + "task": "lookup8", + "prompt": "Use the lookup table.\number: 66\nolive: 63\nnettle: 97\njade: 71\nmaple: 33\niris: 16\nelm: 91\nwillow: 79\nWhich option is the value for nettle?\n1. 66\n2. 97\n3. 71\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup8-007", + "task": "lookup8", + "prompt": "Use the lookup table.\nlarch: 83\nnettle: 43\nwillow: 44\niris: 62\nvine: 97\ncedar: 41\nfern: 33\nkelp: 22\nWhich option is the value for iris?\n1. 62\n2. 44\n3. 43\n4. 22\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-lookup8-008", + "task": "lookup8", + "prompt": "Use the lookup table.\njade: 98\nreed: 75\nquartz: 77\nthyme: 72\nlarch: 33\nolive: 60\nyew: 15\nfern: 36\nWhich option is the value for olive?\n1. 60\n2. 77\n3. 72\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-lookup8-009", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 66\number: 39\nkelp: 50\namber: 99\npine: 92\nnettle: 31\ncedar: 46\nheath: 97\nWhich option is the value for amber?\n1. 39\n2. 66\n3. 31\n4. 99\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup8-010", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 79\nthyme: 91\nlarch: 12\nheath: 92\nolive: 62\njade: 23\ndune: 76\namber: 31\nWhich option is the value for thyme?\n1. 76\n2. 79\n3. 91\n4. 31\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup8-011", + "task": "lookup8", + "prompt": "Use the lookup table.\nbirch: 68\niris: 16\nmaple: 63\namber: 41\nnettle: 42\ndune: 26\ncedar: 21\njade: 48\nWhich option is the value for nettle?\n1. 16\n2. 48\n3. 41\n4. 42\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup16-000", + "task": "lookup16", + "prompt": "Use the lookup table.\npine: 96\number: 12\nlarch: 30\njade: 74\nwillow: 69\nbirch: 66\nolive: 76\nquartz: 99\nyew: 14\ngrove: 41\nthyme: 32\nkelp: 11\nnettle: 42\nelm: 78\namber: 13\nslate: 15\nWhich option is the value for elm?\n1. 69\n2. 30\n3. 78\n4. 96\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup16-001", + "task": "lookup16", + "prompt": "Use the lookup table.\nthyme: 47\nelm: 59\nyew: 12\nheath: 43\njade: 87\nfern: 71\nreed: 19\nquartz: 83\nmaple: 98\ncedar: 62\nslate: 80\namber: 55\npine: 27\nvine: 26\nbirch: 93\number: 81\nWhich option is the value for maple?\n1. 19\n2. 12\n3. 47\n4. 98\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup16-002", + "task": "lookup16", + "prompt": "Use the lookup table.\nslate: 94\nfern: 75\nnettle: 18\nkelp: 51\number: 69\nolive: 41\nquartz: 80\nvine: 11\nreed: 93\nheath: 87\ndune: 61\njade: 73\nyew: 28\npine: 46\nelm: 54\niris: 42\nWhich option is the value for iris?\n1. 42\n2. 51\n3. 80\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-lookup16-003", + "task": "lookup16", + "prompt": "Use the lookup table.\niris: 18\nkelp: 65\nreed: 72\nmaple: 96\ndune: 66\ngrove: 40\nvine: 11\nlarch: 54\nthyme: 15\nwillow: 31\nbirch: 24\nquartz: 29\ncedar: 10\nslate: 77\nyew: 85\nolive: 76\nWhich option is the value for yew?\n1. 66\n2. 76\n3. 31\n4. 85\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup16-004", + "task": "lookup16", + "prompt": "Use the lookup table.\niris: 79\nwillow: 10\njade: 30\nkelp: 74\nheath: 56\ngrove: 12\npine: 63\nbirch: 26\nvine: 66\namber: 87\nmaple: 42\nslate: 81\nyew: 70\nnettle: 44\nquartz: 67\ndune: 54\nWhich option is the value for amber?\n1. 70\n2. 56\n3. 87\n4. 12\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup16-005", + "task": "lookup16", + "prompt": "Use the lookup table.\nheath: 82\niris: 33\nyew: 11\nolive: 49\nslate: 56\nthyme: 90\njade: 60\nnettle: 47\nvine: 35\nkelp: 92\ncedar: 44\ngrove: 29\namber: 58\nbirch: 95\nwillow: 37\nquartz: 91\nWhich option is the value for birch?\n1. 90\n2. 29\n3. 95\n4. 56\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-lookup16-006", + "task": "lookup16", + "prompt": "Use the lookup table.\nwillow: 84\ncedar: 93\number: 83\nslate: 56\namber: 85\nreed: 51\nlarch: 29\nthyme: 62\nnettle: 98\njade: 75\nyew: 10\nkelp: 71\nolive: 18\nvine: 54\nbirch: 67\nfern: 17\nWhich option is the value for jade?\n1. 51\n2. 75\n3. 62\n4. 17\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup16-007", + "task": "lookup16", + "prompt": "Use the lookup table.\nmaple: 25\ncedar: 64\niris: 90\nelm: 77\njade: 46\nwillow: 75\nyew: 65\nreed: 15\npine: 95\nslate: 88\number: 94\nvine: 10\nheath: 89\nthyme: 71\ndune: 53\namber: 51\nWhich option is the value for vine?\n1. 53\n2. 10\n3. 77\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup16-008", + "task": "lookup16", + "prompt": "Use the lookup table.\nelm: 22\nreed: 41\nlarch: 96\nheath: 56\nyew: 54\nvine: 86\ndune: 68\nfern: 44\nmaple: 37\ncedar: 23\nthyme: 81\nwillow: 69\nolive: 48\npine: 28\nslate: 61\nquartz: 80\nWhich option is the value for slate?\n1. 61\n2. 22\n3. 80\n4. 37\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-lookup16-009", + "task": "lookup16", + "prompt": "Use the lookup table.\niris: 52\nmaple: 36\nfern: 83\ndune: 37\nelm: 38\nbirch: 64\ngrove: 57\njade: 78\nolive: 66\nthyme: 41\nslate: 75\nquartz: 94\npine: 40\number: 88\nheath: 76\nwillow: 84\nWhich option is the value for fern?\n1. 64\n2. 83\n3. 37\n4. 78\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-lookup16-010", + "task": "lookup16", + "prompt": "Use the lookup table.\ndune: 42\nslate: 11\nyew: 63\ngrove: 32\number: 36\nolive: 20\nnettle: 72\nwillow: 60\nheath: 82\njade: 16\namber: 45\nkelp: 33\nvine: 58\nthyme: 90\nfern: 17\nbirch: 62\nWhich option is the value for willow?\n1. 42\n2. 11\n3. 82\n4. 60\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-lookup16-011", + "task": "lookup16", + "prompt": "Use the lookup table.\nnettle: 97\njade: 28\nmaple: 29\nvine: 88\nheath: 71\nfern: 63\nelm: 43\ncedar: 95\nkelp: 61\nreed: 84\nslate: 26\nyew: 94\nquartz: 72\ngrove: 68\niris: 14\nlarch: 66\nWhich option is the value for quartz?\n1. 72\n2. 94\n3. 68\n4. 28\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-latest8-000", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nbirch: 79\nkelp: 86\njade: 73\nfern: 11\nfern: 52\nmaple: 61\nwillow: 39\ncedar: 42\nWhich option is the latest value for fern?\n1. 52\n2. 42\n3. 11\n4. 86\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-latest8-001", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ncedar: 78\namber: 97\nnettle: 53\namber: 58\number: 63\npine: 35\nyew: 77\niris: 32\nWhich option is the latest value for amber?\n1. 97\n2. 77\n3. 58\n4. 53\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-latest8-002", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nolive: 57\nvine: 33\nslate: 78\nreed: 61\namber: 58\nmaple: 65\nkelp: 73\nkelp: 60\nWhich option is the latest value for kelp?\n1. 73\n2. 60\n3. 61\n4. 58\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-latest8-003", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nyew: 73\nslate: 97\nfern: 29\number: 91\nquartz: 76\nfern: 68\nmaple: 57\npine: 96\nWhich option is the latest value for fern?\n1. 68\n2. 91\n3. 29\n4. 96\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-latest8-004", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nlarch: 96\namber: 88\nquartz: 34\njade: 36\nyew: 91\niris: 48\niris: 67\nwillow: 78\nWhich option is the latest value for iris?\n1. 34\n2. 78\n3. 48\n4. 67\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-latest8-005", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 25\nfern: 74\njade: 39\niris: 38\number: 41\ndune: 64\nheath: 30\nheath: 75\nWhich option is the latest value for heath?\n1. 30\n2. 39\n3. 75\n4. 74\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-latest8-006", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nvine: 25\ndune: 72\nreed: 43\nlarch: 77\nvine: 44\nmaple: 64\nslate: 30\nquartz: 14\nWhich option is the latest value for vine?\n1. 77\n2. 44\n3. 64\n4. 25\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-latest8-007", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\niris: 93\nyew: 26\nvine: 91\npine: 88\nquartz: 30\nreed: 53\nquartz: 60\njade: 94\nWhich option is the latest value for quartz?\n1. 30\n2. 53\n3. 60\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-latest8-008", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nvine: 37\nyew: 78\nkelp: 71\niris: 36\njade: 18\nquartz: 76\nolive: 11\niris: 45\nWhich option is the latest value for iris?\n1. 11\n2. 71\n3. 36\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-latest8-009", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nvine: 98\njade: 54\nfern: 50\nheath: 89\nnettle: 41\nreed: 40\nkelp: 57\nvine: 81\nWhich option is the latest value for vine?\n1. 81\n2. 57\n3. 89\n4. 98\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-latest8-010", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nheath: 41\ndune: 14\nthyme: 97\nolive: 68\nolive: 96\nvine: 13\nkelp: 53\nnettle: 54\nWhich option is the latest value for olive?\n1. 68\n2. 53\n3. 97\n4. 96\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-latest8-011", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nquartz: 63\nthyme: 49\nnettle: 30\nreed: 24\nelm: 43\niris: 65\nvine: 10\nquartz: 82\nWhich option is the latest value for quartz?\n1. 65\n2. 82\n3. 49\n4. 63\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-arithmetic-000", + "task": "arithmetic", + "prompt": "What is 16 + 71?\n1. 77\n2. 97\n3. 87\n4. 88\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-arithmetic-001", + "task": "arithmetic", + "prompt": "What is 63 + 47?\n1. 100\n2. 110\n3. 111\n4. 120\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-arithmetic-002", + "task": "arithmetic", + "prompt": "What is 18 + 42?\n1. 60\n2. 70\n3. 59\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-arithmetic-003", + "task": "arithmetic", + "prompt": "What is 17 + 43?\n1. 50\n2. 60\n3. 59\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-arithmetic-004", + "task": "arithmetic", + "prompt": "What is 67 + 51?\n1. 128\n2. 108\n3. 117\n4. 118\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-arithmetic-005", + "task": "arithmetic", + "prompt": "What is 31 + 70?\n1. 111\n2. 101\n3. 100\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "validation-arithmetic-006", + "task": "arithmetic", + "prompt": "What is 40 + 50?\n1. 100\n2. 80\n3. 90\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-arithmetic-007", + "task": "arithmetic", + "prompt": "What is 87 + 55?\n1. 152\n2. 143\n3. 132\n4. 142\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-arithmetic-008", + "task": "arithmetic", + "prompt": "What is 78 + 52?\n1. 140\n2. 120\n3. 131\n4. 130\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "validation-arithmetic-009", + "task": "arithmetic", + "prompt": "What is 98 + 16?\n1. 114\n2. 124\n3. 104\n4. 113\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "validation-arithmetic-010", + "task": "arithmetic", + "prompt": "What is 78 + 41?\n1. 120\n2. 109\n3. 119\n4. 129\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "validation-arithmetic-011", + "task": "arithmetic", + "prompt": "What is 63 + 13?\n1. 76\n2. 66\n3. 86\n4. 77\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + } + ], + "test": [ + { + "id": "test-lookup8-000", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 81\ndune: 82\nquartz: 22\nlarch: 28\nheath: 74\njade: 61\number: 27\nelm: 80\nWhich option is the value for heath?\n1. 28\n2. 74\n3. 22\n4. 81\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-001", + "task": "lookup8", + "prompt": "Use the lookup table.\njade: 72\number: 79\nbirch: 63\nyew: 71\nreed: 74\nfern: 57\nkelp: 23\niris: 37\nWhich option is the value for kelp?\n1. 71\n2. 72\n3. 57\n4. 23\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-002", + "task": "lookup8", + "prompt": "Use the lookup table.\nvine: 70\ndune: 42\nreed: 62\nheath: 23\namber: 10\nelm: 49\nyew: 30\nwillow: 57\nWhich option is the value for yew?\n1. 23\n2. 30\n3. 42\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-003", + "task": "lookup8", + "prompt": "Use the lookup table.\ndune: 59\ngrove: 19\nyew: 85\nbirch: 22\namber: 25\nquartz: 83\nkelp: 50\nelm: 30\nWhich option is the value for birch?\n1. 50\n2. 85\n3. 83\n4. 22\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-004", + "task": "lookup8", + "prompt": "Use the lookup table.\nthyme: 73\nolive: 49\namber: 61\niris: 70\ncedar: 86\nnettle: 35\ngrove: 79\nquartz: 44\nWhich option is the value for cedar?\n1. 86\n2. 73\n3. 61\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-005", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 66\nthyme: 59\nslate: 77\ngrove: 65\njade: 10\nreed: 33\niris: 26\nyew: 99\nWhich option is the value for grove?\n1. 65\n2. 10\n3. 99\n4. 77\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-006", + "task": "lookup8", + "prompt": "Use the lookup table.\namber: 88\number: 77\nheath: 80\niris: 76\nelm: 25\nreed: 21\ngrove: 66\nlarch: 34\nWhich option is the value for grove?\n1. 66\n2. 80\n3. 34\n4. 21\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-007", + "task": "lookup8", + "prompt": "Use the lookup table.\nheath: 59\ngrove: 92\nlarch: 91\nolive: 66\npine: 96\nslate: 14\nquartz: 83\njade: 73\nWhich option is the value for jade?\n1. 83\n2. 59\n3. 73\n4. 14\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-008", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 35\nheath: 50\nbirch: 72\nfern: 73\nslate: 70\nyew: 94\nquartz: 84\nreed: 46\nWhich option is the value for willow?\n1. 46\n2. 35\n3. 73\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-009", + "task": "lookup8", + "prompt": "Use the lookup table.\nyew: 30\nkelp: 61\nlarch: 63\nslate: 70\nheath: 38\namber: 69\nthyme: 96\nreed: 87\nWhich option is the value for larch?\n1. 87\n2. 38\n3. 61\n4. 63\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-010", + "task": "lookup8", + "prompt": "Use the lookup table.\niris: 19\nfern: 73\nreed: 83\nquartz: 57\npine: 48\nmaple: 92\nbirch: 32\namber: 23\nWhich option is the value for reed?\n1. 83\n2. 57\n3. 23\n4. 32\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-011", + "task": "lookup8", + "prompt": "Use the lookup table.\nkelp: 80\nwillow: 53\ndune: 34\nslate: 70\nyew: 74\ncedar: 51\njade: 43\nreed: 81\nWhich option is the value for cedar?\n1. 70\n2. 53\n3. 51\n4. 81\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-012", + "task": "lookup8", + "prompt": "Use the lookup table.\nlarch: 81\nelm: 53\nvine: 19\nyew: 80\nbirch: 20\nheath: 27\njade: 91\nreed: 57\nWhich option is the value for jade?\n1. 19\n2. 91\n3. 53\n4. 27\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-013", + "task": "lookup8", + "prompt": "Use the lookup table.\nbirch: 25\niris: 67\nnettle: 37\nquartz: 27\nvine: 99\ncedar: 93\nmaple: 43\nfern: 19\nWhich option is the value for birch?\n1. 93\n2. 67\n3. 25\n4. 99\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-014", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 24\niris: 73\njade: 77\nreed: 88\nvine: 56\nkelp: 38\ngrove: 39\namber: 54\nWhich option is the value for grove?\n1. 77\n2. 56\n3. 54\n4. 39\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-015", + "task": "lookup8", + "prompt": "Use the lookup table.\nvine: 25\ncedar: 53\namber: 29\nquartz: 84\njade: 85\nslate: 30\nreed: 94\nyew: 36\nWhich option is the value for reed?\n1. 29\n2. 94\n3. 85\n4. 84\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-016", + "task": "lookup8", + "prompt": "Use the lookup table.\nkelp: 59\nwillow: 51\nreed: 68\namber: 72\number: 49\nslate: 54\nthyme: 46\njade: 60\nWhich option is the value for amber?\n1. 51\n2. 59\n3. 46\n4. 72\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-017", + "task": "lookup8", + "prompt": "Use the lookup table.\nolive: 27\nmaple: 60\nlarch: 88\nelm: 30\nbirch: 69\nnettle: 84\npine: 76\nyew: 19\nWhich option is the value for elm?\n1. 30\n2. 27\n3. 84\n4. 60\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-018", + "task": "lookup8", + "prompt": "Use the lookup table.\nkelp: 95\nbirch: 30\nelm: 48\nquartz: 42\nwillow: 51\nyew: 12\nreed: 64\ngrove: 68\nWhich option is the value for reed?\n1. 51\n2. 68\n3. 64\n4. 95\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-019", + "task": "lookup8", + "prompt": "Use the lookup table.\ndune: 33\nslate: 55\ngrove: 88\nelm: 68\nkelp: 20\nyew: 78\nolive: 40\nmaple: 71\nWhich option is the value for maple?\n1. 78\n2. 55\n3. 71\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-020", + "task": "lookup8", + "prompt": "Use the lookup table.\ngrove: 67\nnettle: 17\npine: 12\nkelp: 94\nelm: 90\ncedar: 89\namber: 30\nheath: 42\nWhich option is the value for heath?\n1. 30\n2. 12\n3. 42\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-021", + "task": "lookup8", + "prompt": "Use the lookup table.\nvine: 30\ncedar: 32\nlarch: 14\nmaple: 33\nnettle: 90\number: 74\nreed: 41\ngrove: 56\nWhich option is the value for grove?\n1. 74\n2. 56\n3. 90\n4. 32\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-022", + "task": "lookup8", + "prompt": "Use the lookup table.\ndune: 80\nslate: 65\nmaple: 50\nbirch: 89\ngrove: 27\nfern: 26\npine: 34\nthyme: 52\nWhich option is the value for maple?\n1. 65\n2. 52\n3. 34\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-023", + "task": "lookup8", + "prompt": "Use the lookup table.\ndune: 17\nlarch: 46\nslate: 11\nkelp: 63\nbirch: 69\nolive: 68\nvine: 20\namber: 19\nWhich option is the value for larch?\n1. 68\n2. 20\n3. 46\n4. 19\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-024", + "task": "lookup8", + "prompt": "Use the lookup table.\njade: 85\nthyme: 63\number: 71\nelm: 95\nnettle: 44\nreed: 83\niris: 72\nheath: 30\nWhich option is the value for thyme?\n1. 71\n2. 85\n3. 63\n4. 44\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup8-025", + "task": "lookup8", + "prompt": "Use the lookup table.\nslate: 57\nreed: 30\nquartz: 56\ngrove: 98\nyew: 21\nthyme: 18\niris: 37\number: 82\nWhich option is the value for grove?\n1. 18\n2. 98\n3. 57\n4. 56\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-026", + "task": "lookup8", + "prompt": "Use the lookup table.\nheath: 40\nquartz: 33\nnettle: 81\njade: 94\nfern: 34\nelm: 50\nolive: 18\nlarch: 10\nWhich option is the value for quartz?\n1. 94\n2. 81\n3. 10\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-027", + "task": "lookup8", + "prompt": "Use the lookup table.\number: 16\namber: 67\nolive: 93\nheath: 70\njade: 85\npine: 68\nyew: 90\ndune: 23\nWhich option is the value for yew?\n1. 70\n2. 16\n3. 85\n4. 90\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup8-028", + "task": "lookup8", + "prompt": "Use the lookup table.\ncedar: 82\nolive: 35\nheath: 22\nnettle: 95\niris: 23\npine: 33\nreed: 59\nmaple: 14\nWhich option is the value for iris?\n1. 23\n2. 14\n3. 82\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-029", + "task": "lookup8", + "prompt": "Use the lookup table.\nwillow: 80\niris: 41\nmaple: 43\nbirch: 34\nfern: 15\nnettle: 56\nkelp: 94\nheath: 19\nWhich option is the value for birch?\n1. 41\n2. 34\n3. 56\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup8-030", + "task": "lookup8", + "prompt": "Use the lookup table.\nyew: 38\niris: 87\nquartz: 58\nheath: 93\ndune: 96\number: 52\nreed: 51\nolive: 85\nWhich option is the value for umber?\n1. 52\n2. 87\n3. 93\n4. 38\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup8-031", + "task": "lookup8", + "prompt": "Use the lookup table.\nfern: 95\namber: 26\nbirch: 54\nkelp: 88\ndune: 77\ngrove: 47\nyew: 97\nheath: 92\nWhich option is the value for kelp?\n1. 88\n2. 97\n3. 47\n4. 54\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-000", + "task": "lookup16", + "prompt": "Use the lookup table.\ncedar: 23\njade: 44\nwillow: 78\nreed: 91\nmaple: 42\npine: 97\nvine: 92\nheath: 68\nlarch: 40\nnettle: 64\nelm: 86\nslate: 15\niris: 11\nfern: 57\ngrove: 27\nolive: 85\nWhich option is the value for iris?\n1. 11\n2. 27\n3. 42\n4. 85\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-001", + "task": "lookup16", + "prompt": "Use the lookup table.\number: 67\nlarch: 30\nelm: 27\npine: 43\namber: 89\niris: 41\nfern: 20\nwillow: 91\nvine: 15\ncedar: 52\njade: 21\nkelp: 28\nolive: 92\nyew: 99\nreed: 86\nnettle: 32\nWhich option is the value for amber?\n1. 43\n2. 32\n3. 99\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-002", + "task": "lookup16", + "prompt": "Use the lookup table.\nreed: 72\nmaple: 27\nfern: 93\nyew: 14\nslate: 10\nnettle: 79\ngrove: 40\number: 29\nelm: 70\njade: 54\ndune: 43\nlarch: 35\nbirch: 21\nolive: 73\nwillow: 68\nthyme: 41\nWhich option is the value for jade?\n1. 54\n2. 41\n3. 27\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-003", + "task": "lookup16", + "prompt": "Use the lookup table.\njade: 55\nvine: 22\nquartz: 64\nelm: 45\nheath: 12\ncedar: 90\nfern: 82\nslate: 92\nkelp: 59\nbirch: 37\nwillow: 27\npine: 56\nmaple: 48\nyew: 68\nlarch: 32\namber: 66\nWhich option is the value for amber?\n1. 27\n2. 66\n3. 64\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-004", + "task": "lookup16", + "prompt": "Use the lookup table.\npine: 41\ndune: 40\nvine: 92\ncedar: 89\nthyme: 82\nfern: 18\nreed: 54\nlarch: 16\nyew: 85\nmaple: 72\nquartz: 69\nelm: 43\niris: 48\nwillow: 98\number: 13\nbirch: 26\nWhich option is the value for iris?\n1. 89\n2. 48\n3. 69\n4. 40\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-005", + "task": "lookup16", + "prompt": "Use the lookup table.\nbirch: 24\npine: 17\namber: 69\niris: 13\nslate: 77\nelm: 75\nquartz: 57\nnettle: 93\nreed: 58\nmaple: 40\ndune: 53\nolive: 15\nheath: 80\nwillow: 70\nvine: 72\nyew: 61\nWhich option is the value for reed?\n1. 75\n2. 58\n3. 93\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-006", + "task": "lookup16", + "prompt": "Use the lookup table.\nolive: 94\nbirch: 45\njade: 43\nelm: 97\nmaple: 99\ndune: 63\nlarch: 59\nslate: 85\npine: 96\nyew: 98\niris: 68\nreed: 87\nfern: 93\nnettle: 54\nquartz: 15\nthyme: 69\nWhich option is the value for elm?\n1. 97\n2. 99\n3. 87\n4. 93\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-007", + "task": "lookup16", + "prompt": "Use the lookup table.\namber: 37\nslate: 43\nnettle: 47\nolive: 75\ndune: 10\nmaple: 21\nyew: 88\npine: 62\ncedar: 45\nlarch: 30\nvine: 99\nquartz: 51\nkelp: 77\nreed: 98\nheath: 63\ngrove: 60\nWhich option is the value for olive?\n1. 47\n2. 99\n3. 75\n4. 98\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-008", + "task": "lookup16", + "prompt": "Use the lookup table.\nkelp: 47\nlarch: 71\ncedar: 95\nheath: 80\nthyme: 45\nslate: 87\nvine: 48\nyew: 83\nfern: 77\nquartz: 61\namber: 86\njade: 22\nelm: 27\nbirch: 25\nwillow: 12\ngrove: 97\nWhich option is the value for thyme?\n1. 27\n2. 22\n3. 48\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-009", + "task": "lookup16", + "prompt": "Use the lookup table.\nmaple: 42\nkelp: 48\nthyme: 35\nnettle: 97\niris: 16\ndune: 70\namber: 82\nvine: 57\nfern: 85\nreed: 64\number: 88\ngrove: 91\ncedar: 18\nwillow: 96\nyew: 54\nelm: 71\nWhich option is the value for fern?\n1. 85\n2. 18\n3. 42\n4. 64\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-010", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 36\nslate: 64\nvine: 38\nkelp: 66\nelm: 80\ncedar: 88\nquartz: 55\ndune: 26\nyew: 11\npine: 17\namber: 73\nfern: 90\nwillow: 30\nreed: 16\niris: 51\nlarch: 18\nWhich option is the value for fern?\n1. 26\n2. 90\n3. 73\n4. 17\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-011", + "task": "lookup16", + "prompt": "Use the lookup table.\nnettle: 47\nslate: 66\ncedar: 25\nolive: 39\nheath: 32\nmaple: 34\nwillow: 31\nreed: 36\npine: 27\ndune: 64\nthyme: 24\nyew: 14\nelm: 50\nbirch: 54\nfern: 89\nlarch: 79\nWhich option is the value for cedar?\n1. 25\n2. 34\n3. 79\n4. 24\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-012", + "task": "lookup16", + "prompt": "Use the lookup table.\ncedar: 96\niris: 95\namber: 23\nkelp: 37\nquartz: 48\njade: 30\number: 43\nslate: 86\nelm: 47\nnettle: 94\nwillow: 97\nmaple: 50\nolive: 70\nvine: 31\nfern: 88\ndune: 91\nWhich option is the value for olive?\n1. 88\n2. 94\n3. 23\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-013", + "task": "lookup16", + "prompt": "Use the lookup table.\nlarch: 26\nyew: 28\ncedar: 40\nquartz: 29\npine: 39\nkelp: 44\nbirch: 78\nolive: 59\nelm: 73\namber: 69\niris: 79\nwillow: 30\ngrove: 52\nthyme: 12\nmaple: 56\nreed: 21\nWhich option is the value for kelp?\n1. 44\n2. 59\n3. 39\n4. 79\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-014", + "task": "lookup16", + "prompt": "Use the lookup table.\nelm: 55\nyew: 58\niris: 29\nthyme: 47\nvine: 71\nnettle: 36\npine: 78\nbirch: 39\ngrove: 23\nlarch: 69\nquartz: 44\number: 79\nolive: 28\ncedar: 90\nmaple: 27\njade: 75\nWhich option is the value for larch?\n1. 69\n2. 28\n3. 71\n4. 75\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-015", + "task": "lookup16", + "prompt": "Use the lookup table.\nquartz: 38\nyew: 24\nvine: 37\ngrove: 85\nelm: 27\nslate: 50\ndune: 19\nreed: 91\number: 63\nkelp: 81\nolive: 46\npine: 39\niris: 26\nheath: 96\nbirch: 48\nmaple: 92\nWhich option is the value for yew?\n1. 85\n2. 24\n3. 81\n4. 38\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-016", + "task": "lookup16", + "prompt": "Use the lookup table.\niris: 22\nnettle: 35\nolive: 49\ndune: 93\nfern: 67\nkelp: 36\nheath: 17\nmaple: 96\nwillow: 38\number: 63\namber: 89\ngrove: 12\nbirch: 59\nslate: 85\nvine: 61\nthyme: 10\nWhich option is the value for fern?\n1. 35\n2. 49\n3. 36\n4. 67\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-017", + "task": "lookup16", + "prompt": "Use the lookup table.\nslate: 94\nelm: 85\nreed: 58\nkelp: 56\nmaple: 54\nthyme: 71\number: 45\nnettle: 73\nvine: 93\nwillow: 64\nfern: 76\njade: 25\ncedar: 31\nyew: 23\ngrove: 63\nbirch: 78\nWhich option is the value for reed?\n1. 56\n2. 93\n3. 64\n4. 58\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-018", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 81\nnettle: 49\nreed: 59\nlarch: 64\nquartz: 73\nyew: 72\number: 96\nbirch: 56\namber: 76\nslate: 77\nheath: 40\nolive: 20\nwillow: 51\nmaple: 50\ndune: 98\ncedar: 37\nWhich option is the value for cedar?\n1. 64\n2. 37\n3. 73\n4. 49\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-019", + "task": "lookup16", + "prompt": "Use the lookup table.\nvine: 36\nwillow: 46\number: 55\ngrove: 47\npine: 62\nreed: 34\ncedar: 22\nyew: 28\nfern: 72\nlarch: 69\nbirch: 71\nnettle: 43\niris: 97\nthyme: 57\ndune: 16\nslate: 35\nWhich option is the value for umber?\n1. 28\n2. 72\n3. 55\n4. 43\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-020", + "task": "lookup16", + "prompt": "Use the lookup table.\nolive: 19\nkelp: 12\njade: 58\nelm: 75\ndune: 31\nyew: 35\niris: 43\nbirch: 22\nquartz: 98\ngrove: 39\namber: 70\nheath: 85\nvine: 57\number: 60\nreed: 64\nmaple: 81\nWhich option is the value for vine?\n1. 64\n2. 57\n3. 60\n4. 22\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-021", + "task": "lookup16", + "prompt": "Use the lookup table.\ncedar: 41\nelm: 90\nvine: 28\nnettle: 58\njade: 94\nlarch: 66\npine: 38\nwillow: 53\nslate: 11\niris: 56\nquartz: 36\nolive: 33\number: 42\nreed: 47\nthyme: 52\nyew: 61\nWhich option is the value for quartz?\n1. 38\n2. 47\n3. 36\n4. 66\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-022", + "task": "lookup16", + "prompt": "Use the lookup table.\nreed: 18\nwillow: 17\nfern: 30\nbirch: 90\ncedar: 24\nheath: 89\nmaple: 20\nquartz: 48\nkelp: 15\nvine: 74\nyew: 16\ndune: 85\npine: 19\ngrove: 54\nslate: 38\njade: 25\nWhich option is the value for slate?\n1. 17\n2. 90\n3. 74\n4. 38\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-023", + "task": "lookup16", + "prompt": "Use the lookup table.\nnettle: 95\nelm: 36\nmaple: 69\number: 77\njade: 53\nolive: 21\ndune: 55\nreed: 60\nheath: 67\nyew: 85\nwillow: 90\namber: 73\nkelp: 32\npine: 76\nvine: 11\nthyme: 98\nWhich option is the value for umber?\n1. 90\n2. 11\n3. 77\n4. 73\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-024", + "task": "lookup16", + "prompt": "Use the lookup table.\ncedar: 79\number: 11\namber: 44\ndune: 22\nbirch: 34\nnettle: 30\nfern: 55\nquartz: 19\nthyme: 58\nlarch: 83\nolive: 14\nwillow: 24\ngrove: 43\nkelp: 57\nslate: 21\niris: 89\nWhich option is the value for iris?\n1. 34\n2. 24\n3. 19\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-025", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 15\niris: 68\nquartz: 10\npine: 44\ncedar: 76\nreed: 91\nthyme: 52\nfern: 81\nnettle: 74\nlarch: 30\nolive: 36\nmaple: 60\nslate: 19\namber: 12\nwillow: 24\nvine: 13\nWhich option is the value for grove?\n1. 76\n2. 15\n3. 68\n4. 81\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-lookup16-026", + "task": "lookup16", + "prompt": "Use the lookup table.\nnettle: 49\namber: 60\nvine: 37\nreed: 45\ngrove: 24\nwillow: 14\nyew: 82\npine: 11\nelm: 90\nthyme: 27\ndune: 23\nheath: 80\nquartz: 92\nmaple: 86\number: 13\nlarch: 71\nWhich option is the value for yew?\n1. 71\n2. 11\n3. 82\n4. 90\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-027", + "task": "lookup16", + "prompt": "Use the lookup table.\npine: 54\nnettle: 42\nslate: 45\nwillow: 20\ndune: 70\ncedar: 52\nmaple: 91\nquartz: 12\njade: 36\namber: 46\number: 81\niris: 89\nfern: 80\nyew: 53\nkelp: 84\nlarch: 17\nWhich option is the value for kelp?\n1. 89\n2. 20\n3. 84\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-028", + "task": "lookup16", + "prompt": "Use the lookup table.\npine: 91\nfern: 62\nreed: 15\nnettle: 92\nyew: 98\nthyme: 95\nvine: 58\nlarch: 53\nkelp: 37\niris: 18\nwillow: 19\ndune: 45\nbirch: 85\nelm: 28\nquartz: 23\nmaple: 60\nWhich option is the value for kelp?\n1. 60\n2. 62\n3. 37\n4. 85\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-lookup16-029", + "task": "lookup16", + "prompt": "Use the lookup table.\nfern: 32\ncedar: 91\npine: 77\namber: 84\nolive: 58\nreed: 97\ngrove: 62\number: 93\ndune: 25\nelm: 33\nmaple: 27\nvine: 79\nquartz: 54\nheath: 16\niris: 50\nyew: 13\nWhich option is the value for olive?\n1. 54\n2. 77\n3. 84\n4. 58\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-lookup16-030", + "task": "lookup16", + "prompt": "Use the lookup table.\nelm: 23\niris: 92\npine: 25\nwillow: 13\nvine: 88\nkelp: 29\nheath: 66\nlarch: 84\nyew: 35\nthyme: 44\njade: 93\nquartz: 94\number: 32\namber: 10\ndune: 75\ngrove: 28\nWhich option is the value for dune?\n1. 75\n2. 66\n3. 35\n4. 32\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-lookup16-031", + "task": "lookup16", + "prompt": "Use the lookup table.\ngrove: 39\nbirch: 87\nwillow: 84\number: 92\nvine: 17\ncedar: 35\namber: 77\npine: 29\nolive: 68\nslate: 50\nheath: 41\niris: 96\nfern: 12\nquartz: 99\nmaple: 58\nreed: 66\nWhich option is the value for grove?\n1. 17\n2. 58\n3. 39\n4. 12\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-000", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nwillow: 62\nreed: 14\nelm: 25\ngrove: 34\nbirch: 13\nquartz: 21\njade: 29\njade: 99\nWhich option is the latest value for jade?\n1. 62\n2. 99\n3. 34\n4. 29\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-001", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nyew: 31\nvine: 58\nmaple: 70\nvine: 87\nheath: 43\nthyme: 16\nwillow: 71\nelm: 55\nWhich option is the latest value for vine?\n1. 16\n2. 87\n3. 58\n4. 43\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-002", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nwillow: 76\nnettle: 81\nreed: 94\nbirch: 36\npine: 86\nheath: 30\niris: 34\niris: 70\nWhich option is the latest value for iris?\n1. 30\n2. 34\n3. 36\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-003", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ngrove: 61\nkelp: 52\niris: 70\nmaple: 44\nolive: 46\nyew: 65\number: 89\number: 37\nWhich option is the latest value for umber?\n1. 65\n2. 61\n3. 37\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-004", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 70\nfern: 84\nlarch: 35\nvine: 68\nslate: 89\number: 55\nkelp: 60\nvine: 30\nWhich option is the latest value for vine?\n1. 68\n2. 30\n3. 60\n4. 35\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-005", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nfern: 22\nyew: 86\nslate: 16\number: 62\nslate: 57\nlarch: 93\nheath: 65\nbirch: 37\nWhich option is the latest value for slate?\n1. 16\n2. 86\n3. 57\n4. 22\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-006", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nelm: 63\number: 26\njade: 82\ngrove: 54\nthyme: 33\nreed: 93\nheath: 90\njade: 21\nWhich option is the latest value for jade?\n1. 21\n2. 54\n3. 82\n4. 33\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-007", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 63\number: 46\namber: 19\nlarch: 94\ndune: 48\npine: 24\nwillow: 54\ndune: 39\nWhich option is the latest value for dune?\n1. 48\n2. 24\n3. 39\n4. 46\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-008", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\namber: 62\nnettle: 95\nelm: 38\niris: 24\nlarch: 59\nthyme: 80\nlarch: 74\number: 11\nWhich option is the latest value for larch?\n1. 59\n2. 24\n3. 74\n4. 62\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-009", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nbirch: 39\nmaple: 96\nthyme: 87\namber: 12\number: 91\nfern: 20\npine: 35\number: 23\nWhich option is the latest value for umber?\n1. 39\n2. 23\n3. 20\n4. 91\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-010", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nyew: 23\nreed: 67\nvine: 91\nmaple: 24\nheath: 10\nbirch: 11\nbirch: 81\nkelp: 38\nWhich option is the latest value for birch?\n1. 11\n2. 10\n3. 23\n4. 81\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-011", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nyew: 64\nheath: 46\ngrove: 42\nquartz: 91\nslate: 33\npine: 61\npine: 85\nfern: 82\nWhich option is the latest value for pine?\n1. 46\n2. 61\n3. 64\n4. 85\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-012", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nquartz: 78\nelm: 80\nkelp: 99\njade: 24\npine: 41\namber: 50\namber: 65\nbirch: 88\nWhich option is the latest value for amber?\n1. 88\n2. 50\n3. 99\n4. 65\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-013", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\ngrove: 53\nquartz: 19\ncedar: 56\ncedar: 68\nbirch: 64\nlarch: 96\nmaple: 20\ndune: 17\nWhich option is the latest value for cedar?\n1. 68\n2. 53\n3. 96\n4. 56\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-014", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nwillow: 15\npine: 45\nmaple: 44\ndune: 17\nreed: 49\nreed: 18\niris: 72\number: 95\nWhich option is the latest value for reed?\n1. 44\n2. 49\n3. 18\n4. 45\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-015", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nfern: 21\nlarch: 46\namber: 82\nreed: 98\nwillow: 70\number: 33\ndune: 38\nwillow: 91\nWhich option is the latest value for willow?\n1. 38\n2. 91\n3. 46\n4. 70\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-016", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\njade: 22\namber: 92\nheath: 35\nbirch: 26\npine: 73\niris: 44\ndune: 11\namber: 59\nWhich option is the latest value for amber?\n1. 59\n2. 26\n3. 92\n4. 73\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-017", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 39\nelm: 49\nolive: 22\niris: 66\number: 72\nheath: 55\niris: 88\njade: 45\nWhich option is the latest value for iris?\n1. 66\n2. 39\n3. 72\n4. 88\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-018", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 79\nbirch: 57\ngrove: 80\niris: 15\nolive: 20\niris: 74\nlarch: 64\namber: 88\nWhich option is the latest value for iris?\n1. 74\n2. 20\n3. 15\n4. 64\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-019", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 83\nslate: 53\number: 61\nvine: 85\nfern: 51\nelm: 48\npine: 47\number: 21\nWhich option is the latest value for umber?\n1. 21\n2. 61\n3. 47\n4. 85\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-020", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\namber: 21\nvine: 28\nyew: 54\nlarch: 62\ncedar: 44\njade: 26\number: 75\namber: 35\nWhich option is the latest value for amber?\n1. 21\n2. 28\n3. 75\n4. 35\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-021", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nyew: 42\ndune: 73\nlarch: 44\njade: 40\nmaple: 68\nlarch: 30\npine: 47\ngrove: 13\nWhich option is the latest value for larch?\n1. 47\n2. 30\n3. 44\n4. 42\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-022", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nlarch: 28\nmaple: 22\nbirch: 91\nelm: 32\nwillow: 21\ncedar: 69\nyew: 49\nbirch: 40\nWhich option is the latest value for birch?\n1. 21\n2. 91\n3. 40\n4. 49\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-023", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nlarch: 43\npine: 15\ndune: 30\nmaple: 14\nreed: 86\nmaple: 96\nolive: 99\nkelp: 70\nWhich option is the latest value for maple?\n1. 99\n2. 70\n3. 96\n4. 14\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-latest8-024", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 42\nreed: 43\nslate: 76\njade: 94\nreed: 56\nlarch: 11\niris: 48\nquartz: 61\nWhich option is the latest value for reed?\n1. 43\n2. 42\n3. 48\n4. 56\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-025", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nreed: 51\nyew: 46\nlarch: 85\ncedar: 90\nvine: 78\nvine: 59\nwillow: 12\niris: 43\nWhich option is the latest value for vine?\n1. 78\n2. 59\n3. 85\n4. 51\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-026", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\npine: 66\nkelp: 17\nelm: 20\ncedar: 63\nelm: 50\nquartz: 75\nnettle: 94\number: 71\nWhich option is the latest value for elm?\n1. 75\n2. 20\n3. 66\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-latest8-027", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nthyme: 28\nwillow: 17\nfern: 60\nelm: 77\nbirch: 10\nelm: 46\namber: 69\npine: 37\nWhich option is the latest value for elm?\n1. 46\n2. 69\n3. 37\n4. 77\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-028", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nolive: 98\nmaple: 32\nelm: 50\number: 82\nnettle: 79\nslate: 78\ncedar: 63\nelm: 30\nWhich option is the latest value for elm?\n1. 30\n2. 50\n3. 98\n4. 63\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-029", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\njade: 77\niris: 30\nthyme: 40\nbirch: 71\nelm: 24\nquartz: 91\nquartz: 25\nyew: 65\nWhich option is the latest value for quartz?\n1. 91\n2. 25\n3. 65\n4. 40\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-latest8-030", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\nthyme: 60\njade: 75\nolive: 47\nmaple: 91\nnettle: 58\ncedar: 36\nnettle: 87\number: 41\nWhich option is the latest value for nettle?\n1. 87\n2. 47\n3. 41\n4. 58\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-latest8-031", + "task": "latest8", + "prompt": "Use the lookup table (oldest first).\njade: 39\npine: 26\nvine: 34\nmaple: 62\nlarch: 96\nheath: 51\nmaple: 17\ndune: 11\nWhich option is the latest value for maple?\n1. 51\n2. 62\n3. 17\n4. 96\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-000", + "task": "arithmetic", + "prompt": "What is 69 + 55?\n1. 124\n2. 134\n3. 114\n4. 123\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-001", + "task": "arithmetic", + "prompt": "What is 22 + 40?\n1. 63\n2. 72\n3. 62\n4. 52\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-002", + "task": "arithmetic", + "prompt": "What is 33 + 30?\n1. 73\n2. 53\n3. 63\n4. 62\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-003", + "task": "arithmetic", + "prompt": "What is 60 + 58?\n1. 119\n2. 128\n3. 108\n4. 118\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-004", + "task": "arithmetic", + "prompt": "What is 54 + 12?\n1. 56\n2. 66\n3. 76\n4. 65\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-005", + "task": "arithmetic", + "prompt": "What is 73 + 62?\n1. 136\n2. 135\n3. 145\n4. 125\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-006", + "task": "arithmetic", + "prompt": "What is 61 + 49?\n1. 111\n2. 120\n3. 110\n4. 100\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-007", + "task": "arithmetic", + "prompt": "What is 49 + 74?\n1. 133\n2. 113\n3. 122\n4. 123\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-008", + "task": "arithmetic", + "prompt": "What is 36 + 62?\n1. 88\n2. 99\n3. 108\n4. 98\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-009", + "task": "arithmetic", + "prompt": "What is 28 + 22?\n1. 60\n2. 49\n3. 40\n4. 50\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-010", + "task": "arithmetic", + "prompt": "What is 83 + 29?\n1. 112\n2. 102\n3. 111\n4. 122\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-011", + "task": "arithmetic", + "prompt": "What is 66 + 18?\n1. 74\n2. 84\n3. 85\n4. 94\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-012", + "task": "arithmetic", + "prompt": "What is 17 + 21?\n1. 39\n2. 38\n3. 48\n4. 28\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-013", + "task": "arithmetic", + "prompt": "What is 46 + 52?\n1. 98\n2. 99\n3. 88\n4. 108\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-014", + "task": "arithmetic", + "prompt": "What is 76 + 12?\n1. 98\n2. 78\n3. 87\n4. 88\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-015", + "task": "arithmetic", + "prompt": "What is 22 + 27?\n1. 50\n2. 49\n3. 59\n4. 39\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-016", + "task": "arithmetic", + "prompt": "What is 89 + 40?\n1. 129\n2. 119\n3. 139\n4. 130\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-017", + "task": "arithmetic", + "prompt": "What is 15 + 74?\n1. 79\n2. 88\n3. 99\n4. 89\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-018", + "task": "arithmetic", + "prompt": "What is 35 + 62?\n1. 107\n2. 87\n3. 97\n4. 98\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-019", + "task": "arithmetic", + "prompt": "What is 96 + 61?\n1. 157\n2. 167\n3. 147\n4. 158\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-020", + "task": "arithmetic", + "prompt": "What is 14 + 98?\n1. 102\n2. 112\n3. 111\n4. 122\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-021", + "task": "arithmetic", + "prompt": "What is 30 + 12?\n1. 43\n2. 52\n3. 32\n4. 42\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-022", + "task": "arithmetic", + "prompt": "What is 95 + 23?\n1. 118\n2. 119\n3. 128\n4. 108\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-023", + "task": "arithmetic", + "prompt": "What is 41 + 84?\n1. 135\n2. 126\n3. 125\n4. 115\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-024", + "task": "arithmetic", + "prompt": "What is 89 + 45?\n1. 144\n2. 134\n3. 135\n4. 124\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-025", + "task": "arithmetic", + "prompt": "What is 52 + 51?\n1. 104\n2. 103\n3. 113\n4. 93\nAnswer with only the option number.\nAnswer:", + "answer_index": 1 + }, + { + "id": "test-arithmetic-026", + "task": "arithmetic", + "prompt": "What is 29 + 51?\n1. 80\n2. 90\n3. 70\n4. 81\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-027", + "task": "arithmetic", + "prompt": "What is 20 + 28?\n1. 48\n2. 38\n3. 49\n4. 58\nAnswer with only the option number.\nAnswer:", + "answer_index": 0 + }, + { + "id": "test-arithmetic-028", + "task": "arithmetic", + "prompt": "What is 42 + 28?\n1. 80\n2. 60\n3. 70\n4. 71\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-029", + "task": "arithmetic", + "prompt": "What is 98 + 69?\n1. 166\n2. 157\n3. 167\n4. 177\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + }, + { + "id": "test-arithmetic-030", + "task": "arithmetic", + "prompt": "What is 48 + 35?\n1. 82\n2. 93\n3. 73\n4. 83\nAnswer with only the option number.\nAnswer:", + "answer_index": 3 + }, + { + "id": "test-arithmetic-031", + "task": "arithmetic", + "prompt": "What is 82 + 92?\n1. 164\n2. 184\n3. 174\n4. 175\nAnswer with only the option number.\nAnswer:", + "answer_index": 2 + } + ] +} diff --git a/results/lisa-effect-reproduction/real-model-preflight.json b/results/lisa-effect-reproduction/real-model-preflight.json new file mode 100644 index 0000000..8e5221c --- /dev/null +++ b/results/lisa-effect-reproduction/real-model-preflight.json @@ -0,0 +1,12 @@ +{ + "date": "2026-11-23", + "task": "lookup16", + "item": "fit-lookup16-000", + "recipient_layers": [19, 23], + "sample_tokens_including_answer": 158, + "native_hidden_max_abs_error_against_streaming_reference": 0.000020503997802734375, + "skipped_dense_qk_max_abs_difference": 0.0, + "finite_nonzero_huber_gradients_for_all_adapter_parameters": true, + "peak_rss_kib": 555036, + "scope": "One real Qwen3.5-2B fit sample, synthetic task; the backward path used attention distillation only." +} diff --git a/results/lisa-effect-reproduction/runtime.json b/results/lisa-effect-reproduction/runtime.json new file mode 100644 index 0000000..299566e --- /dev/null +++ b/results/lisa-effect-reproduction/runtime.json @@ -0,0 +1,40 @@ +{ + "runtime": "3.14.4", + "platform": "Linux", + "machine": "x86_64", + "logical_cpus": 2, + "cpu": "Intel(R) Xeon(R) Platinum", + "numpy": "2.5.4", + "torch": "2.15.0+cpu", + "tokenizers": "0.23.3", + "main_code_sha256": { + "lisa_effect.py": "8a3ecad71f23e3e8b8faf4a7c21c0c93f00fd0bffe14bdee6117921b548dce8a", + "lisa_tail.py": "4bd2c3c8690a8ae30cc1a9573ec17b7bbe25edf43a33507482719dc03cfeb9af", + "lisa_train.py": "d9b96258111e13a3c72483c954714b9ee56e1f308ec4371bafe47026246051a5", + "lisa_decode.py": "9c723fa245ee4dd8f4d0f9a0d7a3d15e3db3ae40db3fa82ea413ecd24fe20f06", + "lisa_decode_bench.py": "979e566a3391b9418b49beb10c200a48aac706ee95c145510850c929bcc2885a", + "lisa_effect_screen.py": "8aaf515d888f921e60082b69d898cb5037a160c5d09a584db2599f197c4aa74b" + }, + "audit_code_sha256": { + "lisa_effect_audit.py": "75c3445d96521daa2832ee96eb128383fc81f6914d491c2804a9337d1d6af35b", + "lisa_effect_answer_audit.py": "e1d70b10863dab1e13dfa9573c0d87fc6ca017039c3cf9b90f7628f3e7fe5664" + }, + "local_code_match": { + "lisa_effect.py": true, + "lisa_tail.py": true, + "lisa_train.py": true, + "lisa_decode.py": true, + "lisa_decode_bench.py": true, + "lisa_effect_screen.py": true, + "lisa_effect_audit.py": true, + "lisa_effect_answer_audit.py": true + }, + "phase_updates": { + "lisa_decode_bench.py": { + "initial_unexecuted_benchmark_sha256": "0b9867b3f17dbe6373627fa3901c2ea113fc7e0d690b4a358350cfaae62ef223", + "validated_remote_benchmark_sha256": "979e566a3391b9418b49beb10c200a48aac706ee95c145510850c929bcc2885a", + "reason": "Measure compute with resident projections separately from streamed execution", + "remote_numeric_tests": "4 passed; resident projection outputs compared with streamed output" + } + } +} diff --git a/results/lisa-effect-reproduction/screen-rows.json b/results/lisa-effect-reproduction/screen-rows.json new file mode 100644 index 0000000..038db48 --- /dev/null +++ b/results/lisa-effect-reproduction/screen-rows.json @@ -0,0 +1,1186 @@ +[ + { + "id": "screen-lookup8-000", + "task": "lookup8", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.697460174560547, + 18.13253402709961, + 17.23704719543457, + 18.382965087890625 + ], + "nll": 0.18826859815924024 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.718294143676758, + 19.000667572021484, + 17.991352081298828, + 18.993675231933594 + ], + "nll": 0.1446792172733815 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.506038665771484, + 18.599021911621094, + 16.00601577758789, + 16.803054809570312 + ], + "nll": 0.16913618866019675 + } + } + }, + { + "id": "screen-lookup8-001", + "task": "lookup8", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 17.993316650390625, + 20.213001251220703, + 17.064828872680664, + 16.967247009277344 + ], + "nll": 0.1743843647157064 + }, + "direct_23": { + "pred": 1, + "logits": [ + 18.686172485351562, + 21.39635467529297, + 17.978986740112305, + 17.087114334106445 + ], + "nll": 0.10684979025862162 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 17.07736587524414, + 20.15271759033203, + 16.02193832397461, + 15.23991870880127 + ], + "nll": 0.06728065084290336 + } + } + }, + { + "id": "screen-lookup8-002", + "task": "lookup8", + "gold": 2, + "scores": { + "native": { + "pred": 2, + "logits": [ + 17.969684600830078, + 19.48763656616211, + 20.10470199584961, + 18.060754776000977 + ], + "nll": 0.580697370729272 + }, + "direct_23": { + "pred": 2, + "logits": [ + 18.40570068359375, + 20.240917205810547, + 21.170637130737305, + 18.763084411621094 + ], + "nll": 0.4367568411604914 + }, + "direct_19_23": { + "pred": 2, + "logits": [ + 16.879804611206055, + 19.079893112182617, + 19.610210418701172, + 16.44618797302246 + ], + "nll": 0.5281938127388521 + } + } + }, + { + "id": "screen-lookup8-003", + "task": "lookup8", + "gold": 2, + "scores": { + "native": { + "pred": 2, + "logits": [ + 17.80279541015625, + 17.356037139892578, + 20.488859176635742, + 17.542217254638672 + ], + "nll": 0.15208485144998818 + }, + "direct_23": { + "pred": 2, + "logits": [ + 18.156017303466797, + 17.959136962890625, + 21.564891815185547, + 18.242450714111328 + ], + "nll": 0.09195001851948703 + }, + "direct_19_23": { + "pred": 2, + "logits": [ + 15.852276802062988, + 15.687746047973633, + 20.15203285217285, + 15.23642349243164 + ], + "nll": 0.031901708322191524 + } + } + }, + { + "id": "screen-lookup8-004", + "task": "lookup8", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 18.573863983154297, + 20.055904388427734, + 16.86414337158203, + 16.80960464477539 + ], + "nll": 0.26788061162177357 + }, + "direct_23": { + "pred": 1, + "logits": [ + 19.246421813964844, + 21.05280303955078, + 17.82854461669922, + 17.277767181396484 + ], + "nll": 0.20454688401779464 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 17.159854888916016, + 19.307003021240234, + 15.381502151489258, + 14.98310375213623 + ], + "nll": 0.1395855834527282 + } + } + }, + { + "id": "screen-lookup8-005", + "task": "lookup8", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 16.94013023376465, + 16.542648315429688, + 16.951459884643555, + 19.380550384521484 + ], + "nll": 0.21009036362156408 + }, + "direct_23": { + "pred": 3, + "logits": [ + 17.16890525817871, + 16.96182632446289, + 17.722496032714844, + 20.468090057373047 + ], + "nll": 0.12321909594288272 + }, + "direct_19_23": { + "pred": 3, + "logits": [ + 15.292197227478027, + 15.98039436340332, + 16.50947380065918, + 19.044109344482422 + ], + "nll": 0.13930728560993444 + } + } + }, + { + "id": "screen-lookup8-006", + "task": "lookup8", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 17.11652374267578, + 16.14908218383789, + 16.275728225708008, + 19.959869384765625 + ], + "nll": 0.10027963923007377 + }, + "direct_23": { + "pred": 3, + "logits": [ + 17.39360809326172, + 16.45057487487793, + 17.1256103515625, + 21.291948318481445 + ], + "nll": 0.04275358876917679 + }, + "direct_19_23": { + "pred": 3, + "logits": [ + 15.398442268371582, + 14.57382869720459, + 14.703670501708984, + 19.809391021728516 + ], + "nll": 0.023256900522234503 + } + } + }, + { + "id": "screen-lookup8-007", + "task": "lookup8", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.262374877929688, + 17.43246078491211, + 15.70324420928955, + 17.130813598632812 + ], + "nll": 0.10718366130955204 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.62911605834961, + 18.648624420166016, + 17.04732894897461, + 17.904937744140625 + ], + "nll": 0.08170659308651906 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.235082626342773, + 17.353370666503906, + 15.869649887084961, + 16.078411102294922 + ], + "nll": 0.08103374813177666 + } + } + }, + { + "id": "screen-lookup16-000", + "task": "lookup16", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 16.88872528076172, + 16.14708709716797, + 16.960010528564453, + 20.079208374023438 + ], + "nll": 0.09979704099154674 + }, + "direct_23": { + "pred": 3, + "logits": [ + 17.269792556762695, + 16.450607299804688, + 17.859764099121094, + 21.387218475341797 + ], + "nll": 0.051495908317470196 + }, + "direct_19_23": { + "pred": 3, + "logits": [ + 15.100671768188477, + 14.745397567749023, + 16.411354064941406, + 19.365415573120117 + ], + "nll": 0.07328358868863205 + } + } + }, + { + "id": "screen-lookup16-001", + "task": "lookup16", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.488510131835938, + 17.09787368774414, + 16.0688533782959, + 17.28851318359375 + ], + "nll": 0.08295040432784617 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.710893630981445, + 18.390300750732422, + 17.250085830688477, + 18.02066421508789 + ], + "nll": 0.0701328789746114 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 19.679229736328125, + 17.18025016784668, + 16.085111618041992, + 16.89003562927246 + ], + "nll": 0.15796435327756697 + } + } + }, + { + "id": "screen-lookup16-002", + "task": "lookup16", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 18.018705368041992, + 20.121662139892578, + 16.618919372558594, + 16.30113983154297 + ], + "nll": 0.1605239648974255 + }, + "direct_23": { + "pred": 1, + "logits": [ + 19.12122344970703, + 21.744884490966797, + 18.049671173095703, + 17.430601119995117 + ], + "nll": 0.10504005561457674 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 17.223630905151367, + 20.322059631347656, + 15.973359107971191, + 15.117138862609863 + ], + "nll": 0.06159650102341985 + } + } + }, + { + "id": "screen-lookup16-003", + "task": "lookup16", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.98879051208496, + 17.163719177246094, + 15.632684707641602, + 16.214885711669922 + ], + "nll": 0.034385443742909416 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.326194763183594, + 18.373859405517578, + 16.568424224853516, + 17.02125358581543 + ], + "nll": 0.026967995342591422 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.691299438476562, + 17.465137481689453, + 15.097968101501465, + 16.2298641204834 + ], + "nll": 0.05351991302140391 + } + } + }, + { + "id": "screen-lookup16-004", + "task": "lookup16", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 17.79214859008789, + 20.568031311035156, + 17.15114974975586, + 16.350915908813477 + ], + "nll": 0.10422502879557527 + }, + "direct_23": { + "pred": 1, + "logits": [ + 18.620220184326172, + 21.931278228759766, + 18.35892677307129, + 17.025081634521484 + ], + "nll": 0.06949608548148234 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 17.17837142944336, + 20.638917922973633, + 16.43758773803711, + 15.169323921203613 + ], + "nll": 0.04936254889545211 + } + } + }, + { + "id": "screen-lookup16-005", + "task": "lookup16", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 17.53479766845703, + 18.68415069580078, + 16.84090232849121, + 19.94956398010254 + ], + "nll": 0.34795716558404166 + }, + "direct_23": { + "pred": 3, + "logits": [ + 18.01866340637207, + 19.504764556884766, + 18.044052124023438, + 21.36577606201172 + ], + "nll": 0.20440231236331385 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 16.836557388305664, + 19.233001708984375, + 16.32568359375, + 18.974531173706055 + ], + "nll": 0.9096987131989565 + } + } + }, + { + "id": "screen-lookup16-006", + "task": "lookup16", + "gold": 2, + "scores": { + "native": { + "pred": 2, + "logits": [ + 16.98921775817871, + 16.484724044799805, + 19.493764877319336, + 15.481636047363281 + ], + "nll": 0.13901941414050611 + }, + "direct_23": { + "pred": 2, + "logits": [ + 17.624340057373047, + 17.223094940185547, + 20.87921905517578, + 16.869972229003906 + ], + "nll": 0.07933321586813946 + }, + "direct_19_23": { + "pred": 2, + "logits": [ + 15.367234230041504, + 15.439410209655762, + 19.528045654296875, + 15.187620162963867 + ], + "nll": 0.044388081510245314 + } + } + }, + { + "id": "screen-lookup16-007", + "task": "lookup16", + "gold": 2, + "scores": { + "native": { + "pred": 2, + "logits": [ + 17.033109664916992, + 16.85562515258789, + 19.78887939453125, + 15.847414016723633 + ], + "nll": 0.12769232460464508 + }, + "direct_23": { + "pred": 2, + "logits": [ + 17.37920379638672, + 17.565170288085938, + 21.109859466552734, + 17.02695655822754 + ], + "nll": 0.06739054010574463 + }, + "direct_19_23": { + "pred": 2, + "logits": [ + 15.072863578796387, + 15.016660690307617, + 19.528406143188477, + 14.411680221557617 + ], + "nll": 0.028187879817352268 + } + } + }, + { + "id": "screen-latest8-000", + "task": "latest8", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.48825454711914, + 19.02859115600586, + 17.22644805908203, + 18.19845962524414 + ], + "nll": 0.3162118050706191 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.713150024414062, + 20.182950973510742, + 18.389938354492188, + 19.083599090576172 + ], + "nll": 0.2811409618603946 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.123878479003906, + 19.056987762451172, + 17.07024383544922, + 17.242122650146484 + ], + "nll": 0.36969980568397176 + } + } + }, + { + "id": "screen-latest8-001", + "task": "latest8", + "gold": 2, + "scores": { + "native": { + "pred": 2, + "logits": [ + 19.185199737548828, + 18.878978729248047, + 20.27124786376953, + 18.270465850830078 + ], + "nll": 0.5430728817198087 + }, + "direct_23": { + "pred": 2, + "logits": [ + 19.902921676635742, + 19.681293487548828, + 21.37285804748535, + 19.145679473876953 + ], + "nll": 0.4200275035566996 + }, + "direct_19_23": { + "pred": 2, + "logits": [ + 17.883634567260742, + 17.9761962890625, + 19.26708984375, + 17.797462463378906 + ], + "nll": 0.5628943384753597 + } + } + }, + { + "id": "screen-latest8-002", + "task": "latest8", + "gold": 2, + "scores": { + "native": { + "pred": 1, + "logits": [ + 19.411632537841797, + 20.273160934448242, + 19.094589233398438, + 17.588376998901367 + ], + "nll": 1.7655078325020277 + }, + "direct_23": { + "pred": 1, + "logits": [ + 20.324417114257812, + 21.398067474365234, + 20.202526092529297, + 18.477771759033203 + ], + "nll": 1.7251199975768792 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 18.58944320678711, + 19.974435806274414, + 18.346458435058594, + 16.285293579101562 + ], + "nll": 2.01435843303085 + } + } + }, + { + "id": "screen-latest8-003", + "task": "latest8", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 18.382789611816406, + 20.32406997680664, + 16.999725341796875, + 17.628414154052734 + ], + "nll": 0.2207521149768965 + }, + "direct_23": { + "pred": 1, + "logits": [ + 19.164691925048828, + 21.479473114013672, + 18.02234649658203, + 18.22458267211914 + ], + "nll": 0.15605718716187056 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 17.740764617919922, + 20.329431533813477, + 16.395824432373047, + 16.229106903076172 + ], + "nll": 0.10549482572956492 + } + } + }, + { + "id": "screen-latest8-004", + "task": "latest8", + "gold": 1, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.318523406982422, + 20.134471893310547, + 18.298242568969727, + 18.965839385986328 + ], + "nll": 0.9829345877203579 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.20392608642578, + 21.05996322631836, + 19.185420989990234, + 19.673099517822266 + ], + "nll": 0.9392742179943205 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 19.751558303833008, + 19.838382720947266, + 17.46748924255371, + 17.94879913330078 + ], + "nll": 0.7707422952809324 + } + } + }, + { + "id": "screen-latest8-005", + "task": "latest8", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 17.792476654052734, + 17.54779815673828, + 17.14533233642578, + 20.314836502075195 + ], + "nll": 0.16986281051144303 + }, + "direct_23": { + "pred": 3, + "logits": [ + 18.431991577148438, + 18.296232223510742, + 18.052762985229492, + 21.479644775390625 + ], + "nll": 0.11457992750260004 + }, + "direct_19_23": { + "pred": 3, + "logits": [ + 16.172147750854492, + 16.870895385742188, + 15.963250160217285, + 19.890804290771484 + ], + "nll": 0.0887102557959949 + } + } + }, + { + "id": "screen-latest8-006", + "task": "latest8", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.09866714477539, + 19.31722640991211, + 18.00760269165039, + 19.855213165283203 + ], + "nll": 0.40695421204076965 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.25229263305664, + 20.419591903686523, + 19.064666748046875, + 20.844146728515625 + ], + "nll": 0.36869532316333675 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 21.04738998413086, + 19.66586685180664, + 17.489246368408203, + 19.02706527709961 + ], + "nll": 0.34521938450031087 + } + } + }, + { + "id": "screen-latest8-007", + "task": "latest8", + "gold": 3, + "scores": { + "native": { + "pred": 3, + "logits": [ + 17.785877227783203, + 18.612308502197266, + 16.874256134033203, + 19.940074920654297 + ], + "nll": 0.3560511196193694 + }, + "direct_23": { + "pred": 3, + "logits": [ + 18.56637954711914, + 19.643047332763672, + 18.121681213378906, + 21.367156982421875 + ], + "nll": 0.24533124790591998 + }, + "direct_19_23": { + "pred": 3, + "logits": [ + 16.443283081054688, + 17.8532657623291, + 15.948772430419922, + 19.68533706665039 + ], + "nll": 0.2013076983721156 + } + } + }, + { + "id": "screen-arithmetic-000", + "task": "arithmetic", + "gold": 2, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.679140090942383, + 20.980295181274414, + 20.54197120666504, + 20.532123565673828 + ], + "nll": 1.8958546372911016 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.5401668548584, + 21.86333465576172, + 21.388681411743164, + 21.146757125854492 + ], + "nll": 1.8802982958227012 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.587997436523438, + 20.481082916259766, + 19.995311737060547, + 19.891740798950195 + ], + "nll": 1.6744538161832914 + } + } + }, + { + "id": "screen-arithmetic-001", + "task": "arithmetic", + "gold": 2, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.53711700439453, + 21.3193359375, + 20.240156173706055, + 19.73122787475586 + ], + "nll": 2.1043251929197027 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.545793533325195, + 22.452268600463867, + 21.374902725219727, + 20.46916389465332 + ], + "nll": 2.0236698535596425 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 20.53709602355957, + 20.710960388183594, + 19.288074493408203, + 18.25749969482422 + ], + "nll": 2.196425171642886 + } + } + }, + { + "id": "screen-arithmetic-002", + "task": "arithmetic", + "gold": 1, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.6807861328125, + 21.088253021240234, + 20.17969512939453, + 19.821975708007812 + ], + "nll": 1.2509178549084687 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.524755477905273, + 21.986984252929688, + 20.931936264038086, + 20.321147918701172 + ], + "nll": 1.1784687462927046 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 20.465808868408203, + 20.511062622070312, + 19.321434020996094, + 18.32925796508789 + ], + "nll": 0.8641241765862162 + } + } + }, + { + "id": "screen-arithmetic-003", + "task": "arithmetic", + "gold": 1, + "scores": { + "native": { + "pred": 1, + "logits": [ + 21.122547149658203, + 21.34246826171875, + 20.70867919921875, + 20.044897079467773 + ], + "nll": 0.9579523991962695 + }, + "direct_23": { + "pred": 1, + "logits": [ + 21.866296768188477, + 22.33220863342285, + 21.721757888793945, + 20.74059295654297 + ], + "nll": 0.8646879173074673 + }, + "direct_19_23": { + "pred": 1, + "logits": [ + 19.823379516601562, + 20.549484252929688, + 20.15471839904785, + 18.400344848632812 + ], + "nll": 0.8216336440219969 + } + } + }, + { + "id": "screen-arithmetic-004", + "task": "arithmetic", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.85274887084961, + 21.080223083496094, + 19.965991973876953, + 20.453893661499023 + ], + "nll": 0.6207308008329804 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.839492797851562, + 22.0347900390625, + 20.95907974243164, + 21.18810272216797 + ], + "nll": 0.5830705950657702 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 21.061513900756836, + 20.75944709777832, + 19.17621612548828, + 18.908721923828125 + ], + "nll": 0.6967566197153197 + } + } + }, + { + "id": "screen-arithmetic-005", + "task": "arithmetic", + "gold": 3, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.582143783569336, + 21.089305877685547, + 20.387611389160156, + 20.789596557617188 + ], + "nll": 1.6539280417608495 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.518150329589844, + 22.081573486328125, + 21.37140655517578, + 21.587909698486328 + ], + "nll": 1.7882126509472052 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.543651580810547, + 20.318185806274414, + 19.306381225585938, + 19.54574203491211 + ], + "nll": 1.896837969683311 + } + } + }, + { + "id": "screen-arithmetic-006", + "task": "arithmetic", + "gold": 3, + "scores": { + "native": { + "pred": 0, + "logits": [ + 20.83462905883789, + 20.510099411010742, + 20.457305908203125, + 20.674678802490234 + ], + "nll": 1.341906845703143 + }, + "direct_23": { + "pred": 0, + "logits": [ + 21.454994201660156, + 21.409591674804688, + 21.38341522216797, + 21.451438903808594 + ], + "nll": 1.3601598745372243 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 20.444381713867188, + 19.630416870117188, + 19.463001251220703, + 19.576095581054688 + ], + "nll": 1.6736727051787526 + } + } + }, + { + "id": "screen-arithmetic-007", + "task": "arithmetic", + "gold": 0, + "scores": { + "native": { + "pred": 0, + "logits": [ + 21.727981567382812, + 20.88080596923828, + 20.016000747680664, + 19.921415328979492 + ], + "nll": 0.5728697175954665 + }, + "direct_23": { + "pred": 0, + "logits": [ + 22.749502182006836, + 21.910072326660156, + 20.962127685546875, + 20.60371971130371 + ], + "nll": 0.5401896313612511 + }, + "direct_19_23": { + "pred": 0, + "logits": [ + 21.038467407226562, + 20.210037231445312, + 19.096824645996094, + 18.499927520751953 + ], + "nll": 0.5063259482237896 + } + } + } +] diff --git a/results/lisa-effect-reproduction/screen-summary.json b/results/lisa-effect-reproduction/screen-summary.json new file mode 100644 index 0000000..79bc657 --- /dev/null +++ b/results/lisa-effect-reproduction/screen-summary.json @@ -0,0 +1,82 @@ +{ + "lookup8": { + "native": { + "n": 8, + "correct": 8, + "native_wins_lost": 0, + "nll": 0.22260868260464628 + }, + "direct_23": { + "n": 8, + "correct": 8, + "native_wins_lost": 0, + "nll": 0.15405775362854435 + }, + "direct_19_23": { + "n": 8, + "correct": 8, + "native_wins_lost": 0, + "nll": 0.1474619847851022 + } + }, + "lookup16": { + "native": { + "n": 8, + "correct": 8, + "native_wins_lost": 0, + "nll": 0.137068848385562 + }, + "direct_23": { + "n": 8, + "correct": 8, + "native_wins_lost": 0, + "nll": 0.08428237400849126 + }, + "direct_19_23": { + "n": 8, + "correct": 7, + "native_wins_lost": 1, + "nll": 0.17225019742912862 + } + }, + "latest8": { + "native": { + "n": 8, + "correct": 6, + "native_wins_lost": 0, + "nll": 0.5951684205201615 + }, + "direct_23": { + "n": 8, + "correct": 6, + "native_wins_lost": 0, + "nll": 0.5312782958402527 + }, + "direct_19_23": { + "n": 8, + "correct": 7, + "native_wins_lost": 0, + "nll": 0.5573033796086375 + } + }, + "arithmetic": { + "native": { + "n": 8, + "correct": 3, + "native_wins_lost": 0, + "nll": 1.2998106862759977 + }, + "direct_23": { + "n": 8, + "correct": 3, + "native_wins_lost": 0, + "nll": 1.2773446956117458 + }, + "direct_19_23": { + "n": 8, + "correct": 4, + "native_wins_lost": 0, + "nll": 1.2912787564044454 + } + } +} diff --git a/results/lisa-effect-reproduction/selection.json b/results/lisa-effect-reproduction/selection.json new file mode 100644 index 0000000..24bf5bd --- /dev/null +++ b/results/lisa-effect-reproduction/selection.json @@ -0,0 +1,13 @@ +{ + "task": "lookup16", + "sites": [ + 19, + 23 + ], + "fixed_problems_sha256": "34252a9e02e79c0e0d786ee8b90bb0c5a4fe22e97852929fedf73db7b6dc7826", + "source_sha256": { + "manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de", + "model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4", + "tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42" + } +} diff --git a/tests/test_lisa_effect_audit.py b/tests/test_lisa_effect_audit.py new file mode 100644 index 0000000..dfd10c9 --- /dev/null +++ b/tests/test_lisa_effect_audit.py @@ -0,0 +1,30 @@ +"""Check answer-only metrics and isolate recovery from newly lost items.""" +import unittest + +import numpy as np +import torch +from torch.nn import functional as F + +from crossqkv.lisa_effect_answer_audit import vocabulary_scores +from crossqkv.lisa_effect_audit import paired +from tests.test_lisa_tail import Tensor + + +class EffectAuditTests(unittest.TestCase): + def test_paired_rescue_excludes_natively_wrong_items(self): + native, direct, candidate = (np.array(x, dtype=bool) for x in + [(1, 1, 1, 0), (0, 0, 1, 1), (1, 0, 0, 1)]) + result = paired(native, direct, candidate) + self.assertEqual(result['native_correct_lost_by_direct'], 2) + self.assertEqual(result['rescued'], 1) + self.assertEqual(result['newly_lost_among_native_and_direct_correct'], 1) + self.assertEqual(result['accuracy_delta_vs_direct'], 0) + + def test_streamed_answer_scores_match_full_reference(self): + g = torch.Generator().manual_seed(9) + h, w = torch.randn(4, 6, generator=g), torch.randn(1033, 6, generator=g) + target = torch.tensor([2, 1032, 22, 1024]) + actual, loss = vocabulary_scores(h, target, Tensor(w.numpy())) + logits = F.linear(h, w) + torch.testing.assert_close(actual, logits.argmax(-1)) + torch.testing.assert_close(loss, F.cross_entropy(logits, target, reduction='none')) diff --git a/tests/test_lisa_effect_resume.py b/tests/test_lisa_effect_resume.py new file mode 100644 index 0000000..c446758 --- /dev/null +++ b/tests/test_lisa_effect_resume.py @@ -0,0 +1,62 @@ +"""Check exact epoch resume through the actual LiSA training entry point.""" +import json +from pathlib import Path +from tempfile import TemporaryDirectory +import unittest +from unittest.mock import patch + +import numpy as np +import torch + +from crossqkv.lisa_effect import train +from functional.model import PREFIX +from functional.reference_check import ArrayLM +from tests.test_lisa_tail import Tensor + + +class TrainingResumeTests(unittest.TestCase): + def test_checkpoint_resume_preserves_all_selected_outputs(self): + rng = np.random.default_rng(22) + + def rand(shape): + return (.13*rng.standard_normal(shape)).astype('f4') + + torch.set_num_threads(1) + c = {'rms_norm_eps': 1e-6, 'layer_types': ['full_attention'], 'hidden_size': 8, + 'num_attention_heads': 2, 'num_key_value_heads': 1, 'head_dim': 8, + 'rope_parameters': {'rope_theta': 10000., 'partial_rotary_factor': .5}} + shapes = {'input_layernorm': (8,), 'post_attention_layernorm': (8,), + 'self_attn.q_proj': (32, 8), 'self_attn.k_proj': (8, 8), + 'self_attn.v_proj': (8, 8), 'self_attn.o_proj': (8, 16), + 'self_attn.q_norm': (8,), 'self_attn.k_norm': (8,), + 'mlp.gate_proj': (13, 8), 'mlp.up_proj': (13, 8), 'mlp.down_proj': (8, 13)} + weights = {f'layers.0.{k}.weight': rand(v) for k, v in shapes.items()} + weights.update({'embed_tokens.weight': rand((12,8)), 'norm.weight': rand((8,))}) + model = ArrayLM(weights, c) + model.tensors = {PREFIX+k: Tensor(v) for k,v in weights.items()} + with TemporaryDirectory() as directory: + p = Path(directory) + cache, out = p/'cache', p/'out' + cache.mkdir() + out.mkdir() + (p/'model_config.json').write_text(json.dumps(c)) + (cache/'selection.json').write_text(json.dumps({'sites':[0], 'task':'fixture', + 'source_sha256':{}})) + labels = np.arange(1, 5, dtype=np.int64) + for split, count in [('fit',12), ('validation',12), ('test',32)]: + for i in range(0, count, 4): + ids = rng.integers(1, 12, size=(4, 4)) + gold = rng.integers(0, 4, size=4) + ids[:, -1] = labels[gold] + expected, _ = model.forward(ids) + np.savez(cache/f'{split}-{i:03}.npz', ids=ids, lengths=np.full(4,4), + labels=labels, gold=gold, residual=model.embedding(ids), + donor=rand((4,2,4,4)), expected=expected, + names=[f'{split}-{k}' for k in range(i,i+4)]) + with patch('functional.model.StreamingLM', return_value=model), patch('builtins.print'): + train(p, cache, out, 1) + before = (out/'test-items.json').read_bytes() + lines = (out/'trace.json').read_bytes() + train(p, cache, out, 1, resume=True) + self.assertEqual(before, (out/'test-items.json').read_bytes()) + self.assertEqual(lines, (out/'trace.json').read_bytes()) diff --git a/tests/test_lisa_effect_screen.py b/tests/test_lisa_effect_screen.py new file mode 100644 index 0000000..c96c022 --- /dev/null +++ b/tests/test_lisa_effect_screen.py @@ -0,0 +1,53 @@ +"""Prove shared-prefix replay matches the original replicated-batch screen.""" +import unittest + +import numpy as np +from tokenizers import Tokenizer +from tokenizers.models import WordLevel +from tokenizers.pre_tokenizers import Whitespace + +from crossqkv.lisa_effect_screen import MODES, ScreeningModel, evaluate, problems +from functional.model import PREFIX +from functional.reference_check import ArrayLM + + +class ArrayTensor: + def __init__(self, values): + self.raw = values + self.shape = values.shape + self.dtype = 'F32' + + def evict(self): + pass + + +class TinyScreen(ScreeningModel, ArrayLM): + pass + + +class ScreenTests(unittest.TestCase): + def test_replay_preserves_all_three_arms(self): + rng = np.random.default_rng(11) + cfg = {'rms_norm_eps': 1e-6, 'layer_types': ['full_attention']*24, + 'num_attention_heads': 2, 'num_key_value_heads': 1, 'head_dim': 8, + 'rope_parameters': {'rope_theta': 10000., 'partial_rotary_factor': .5}} + rand = lambda shape: (.12*rng.standard_normal(shape)).astype('f4') + weights = {'norm.weight': rand((8,)), 'embed_tokens.weight': rand((15, 8))} + shapes = {'input_layernorm': (8,), 'post_attention_layernorm': (8,), + 'self_attn.q_proj': (32, 8), 'self_attn.k_proj': (8, 8), + 'self_attn.v_proj': (8, 8), 'self_attn.o_proj': (8, 16), + 'self_attn.q_norm': (8,), 'self_attn.k_norm': (8,), + 'mlp.gate_proj': (13, 8), 'mlp.up_proj': (13, 8), 'mlp.down_proj': (8, 13)} + weights.update({f'layers.{i}.{k}.weight': rand(v) for i in range(24) for k,v in shapes.items()}) + model = TinyScreen(weights, cfg) + model.tensors = {PREFIX+k: ArrayTensor(v) for k,v in weights.items()} + tok = Tokenizer(WordLevel({'[UNK]': 0, **{str(i): i for i in range(1, 10)}}, unk_token='[UNK]')) + tok.pre_tokenizer = Whitespace() + examples = problems('screen', 2) + originals = evaluate(model, tok, examples) + model.reuse_prefix = True + replay = evaluate(model, tok, examples) + for orig, new in zip(originals, replay): + for key in MODES: + np.testing.assert_allclose(orig['scores'][key]['logits'], + new['scores'][key]['logits'], atol=1e-6) diff --git a/tests/test_lisa_tail.py b/tests/test_lisa_tail.py new file mode 100644 index 0000000..8373cbb --- /dev/null +++ b/tests/test_lisa_tail.py @@ -0,0 +1,138 @@ +"""Check streamed frozen gradients and the Torch tail against the CPU reference.""" +import unittest + +import numpy as np +import torch +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_tail import FrozenLinear, TorchTail, gated_delta, rotate +from crossqkv.lisa_train import LearnableSharingAttention +from functional.model import PREFIX, delta_rule, rope +from functional.reference_check import ArrayLM + + +class Tensor: + def __init__(self, value): + self.value = value + self.shape = value.shape + + def read(self, selection): + return self.value.ravel()[selection] + + def evict(self): + pass + + +class TailTests(unittest.TestCase): + def test_frozen_rows_and_input_gradient(self): + torch.manual_seed(4) + x = torch.randn(2, 3, 5, requires_grad=True) + w = torch.randn(14, 5) + actual = FrozenLinear.apply(x, Tensor(w.numpy()), 2, 11) + dense = F.linear(x, w[2:11]) + torch.testing.assert_close(actual, dense) + torch.testing.assert_close(torch.autograd.grad(actual.square().sum(), x)[0], + torch.autograd.grad(dense.square().sum(), x)[0]) + + def test_rotary_and_gated_delta(self): + rng = np.random.default_rng(8) + q, k, v = [rng.normal(size=(2, 5, 2, 8)).astype('f4') for _ in range(3)] + g = -np.abs(rng.normal(size=(2, 5, 2)).astype('f4')) + b = rng.uniform(size=(2, 5, 2)).astype('f4') + tx = torch.tensor(q) + torch.testing.assert_close(rotate(tx, 10000000., .5), + torch.tensor(rope(q, 10000000., .5))) + actual = gated_delta(*map(torch.tensor, (q, k, v, g, b))) + torch.testing.assert_close(actual, torch.tensor(delta_rule(q, k, v, g, b)[0])) + + def test_two_recipient_forward_parity_and_both_get_gradients(self): + rng = np.random.default_rng(5) + cfg = {'rms_norm_eps': 1e-6, 'layer_types': ['full_attention', 'linear_attention', + 'full_attention'], 'num_attention_heads': 2, 'num_key_value_heads': 1, + 'head_dim': 8, 'linear_num_key_heads': 1, 'linear_num_value_heads': 2, + 'linear_key_head_dim': 4, 'linear_value_head_dim': 4, + 'rope_parameters': {'rope_theta': 10000., 'partial_rotary_factor': .5}} + + def rand(*shape): + return (rng.normal(size=shape) * .2).astype('f4') + + a = {'norm.weight': rand(8), 'embed_tokens.weight': rand(10, 8)} + for i, kind in enumerate(cfg['layer_types']): + names = {'input_layernorm': (8,), 'post_attention_layernorm': (8,), + 'mlp.gate_proj': (12, 8), 'mlp.up_proj': (12, 8), 'mlp.down_proj': (8, 12)} + if kind == 'full_attention': + names.update({'self_attn.q_proj': (32, 8), 'self_attn.k_proj': (8, 8), + 'self_attn.v_proj': (8, 8), 'self_attn.o_proj': (8, 16), + 'self_attn.q_norm': (8,), 'self_attn.k_norm': (8,)}) + else: + names.update({'linear_attn.in_proj_qkv': (16, 8), 'linear_attn.in_proj_z': (8, 8), + 'linear_attn.in_proj_b': (2, 8), 'linear_attn.in_proj_a': (2, 8), + 'linear_attn.out_proj': (8, 8), 'linear_attn.norm': (4,), + 'linear_attn.conv1d': (16, 1, 3)}) + a[f'layers.{i}.linear_attn.A_log'] = rand(2) + a[f'layers.{i}.linear_attn.dt_bias'] = rand(2) + a.update({f'layers.{i}.{name}.weight': rand(*shape) for name, shape in names.items()}) + original = ArrayLM(a, cfg) + original.tensors = {PREFIX+k: Tensor(v) for k,v in a.items()} + ids = rng.integers(0, 10, (2, 5)) + h = torch.tensor(original.embedding(ids)) + expected, _ = original.forward(ids) + adapters = {i: LearnableSharingAttention(8, 2, 1, 4, 10000., .5, 16) + for i in (0, 2)} + tail = TorchTail(original, 0, adapters) + 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) + 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) + torch.testing.assert_close(run, ref) + run.square().sum().backward() + self.assertTrue(all(p.grad is not None and p.grad.abs().sum() > 0 for p in tail.parameters())) + + + def test_decode_uses_rotary_offsets_and_compact_key_cache(self): + rng = np.random.default_rng(252) + cfg = {'rms_norm_eps': 1e-6, 'layer_types': ['full_attention'], + 'num_attention_heads': 2, 'num_key_value_heads': 1, 'head_dim': 16, + 'rope_parameters': {'rope_theta': 10000., 'partial_rotary_factor': .5}} + names = {'q_proj': (64, 8), 'k_proj': (16, 8), 'v_proj': (16, 8), + 'o_proj': (8, 32), 'q_norm': (16,), 'k_norm': (16,)} + weights = {'layers.0.self_attn.' + k + '.weight': + rng.normal(0, .2, shape).astype('f4') for k, shape in names.items()} + source = ArrayLM(weights, cfg) + source.tensors = {PREFIX+k: Tensor(v) for k,v in weights.items()} + adapter = LearnableSharingAttention(8, 2, 1, 4, 10000., .5, width=12) + tail = TorchTail(source, 0, {0: adapter}) + hidden = torch.tensor(rng.normal(0, .8, (2, 5, 8)).astype('f4')) + donor = torch.tensor(rng.normal(0, 1, (2, 2, 5, 5)).astype('f4')) + lengths = torch.tensor([5, 5]) + native = AttentionSiteCache(tail, 0, 2, 5) + shared = AttentionSiteCache(tail, 0, 2, 5, adapter) + for mode, cache in [('native', native), ('lisa', shared)]: + out, raw, _ = tail.full(hidden, 0, donor, lengths, mode, (0,), False) + for pos in range(hidden.shape[1]): + row = donor[:, :, pos:pos+1, :pos+1] if mode == 'lisa' else None + actual, scores = cache.step(hidden[:, pos:pos+1], row) + torch.testing.assert_close(actual, out[:, pos:pos+1], atol=2e-6, rtol=2e-5) + torch.testing.assert_close(scores, raw[:, :, pos:pos+1, :pos+1], + atol=2e-6, rtol=2e-5) + cache.reset() + cache.prefill(hidden[:, :4]) + row = donor[:, :, 4:5, :] if mode == 'lisa' else None + actual, scores = cache.step(hidden[:, 4:5], row) + torch.testing.assert_close(actual, out[:, 4:5], atol=2e-6, rtol=2e-5) + torch.testing.assert_close(scores, raw[:, :, 4:5, :], atol=2e-6, rtol=2e-5) + self.assertEqual(shared.allocated_bytes['v'], native.allocated_bytes['v']) + self.assertEqual(shared.allocated_bytes['k']*4, native.allocated_bytes['k']) + resident = ResidentSite(tail, 0) + _, original_states = timed_site({'native': native, 'lisa': shared}, hidden, donor, 5, + samples=2, rounds=2) + _, warm_states = timed_site({'native': AttentionSiteCache(resident, 0, 2, 5), + 'lisa': AttentionSiteCache(resident, 0, 2, 5, adapter)}, + hidden, donor, 5, samples=2, rounds=2) + for mode in ('native', 'lisa'): + for old, new in zip(original_states[mode], warm_states[mode]): + torch.testing.assert_close(old, new, atol=2e-6, rtol=2e-5) diff --git a/tests/test_lisa_train.py b/tests/test_lisa_train.py index ae659c7..ea4f280 100644 --- a/tests/test_lisa_train.py +++ b/tests/test_lisa_train.py @@ -27,6 +27,22 @@ class LiSATrainingTests(unittest.TestCase): torch.testing.assert_close(torch.autograd.grad(streamed, hidden)[0], torch.autograd.grad(dense, hidden)[0]) + def test_answer_weighted_ce_matches_dense(self): + torch.manual_seed(12) + h = torch.randn((2, 4, 3), dtype=torch.float64, requires_grad=True) + w = torch.randn((5, 3), dtype=h.dtype) + ids = torch.randint(0, 5, (2, 4)) + lengths = torch.tensor([4, 3]) + valid = torch.arange(1, 4) < lengths[:, None] + answer = torch.arange(2, 5) == lengths[:, None] + weights = torch.where(answer, 16., 1.)[valid] + ce = F.cross_entropy(F.linear(h[:, :-1][valid], w), ids[:, 1:][valid], reduction='none') + dense = (ce * weights).sum() / weights.sum() + streamed = language_model_loss(h, ids, lengths, lambda: iter([(0, w)]), answer_weight=16.) + torch.testing.assert_close(streamed, dense) + torch.testing.assert_close(torch.autograd.grad(streamed, h)[0], + torch.autograd.grad(dense, 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) -- 2.52.0 From 59072884ff871e90e55625cd5583064b6be3d3b5 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 00:06:58 +0800 Subject: [PATCH 2/4] Cross-check LiSA held-out metrics across scoring paths --- crossqkv/lisa_effect_audit.py | 77 ++++++++++++++++--- docs/LISA_EFFECT_PROTOCOL.md | 7 +- results/lisa-effect-reproduction/runtime.json | 9 +++ tests/test_lisa_effect_audit.py | 38 ++++++++- 4 files changed, 119 insertions(+), 12 deletions(-) diff --git a/crossqkv/lisa_effect_audit.py b/crossqkv/lisa_effect_audit.py index 67a9cb2..ff0398d 100644 --- a/crossqkv/lisa_effect_audit.py +++ b/crossqkv/lisa_effect_audit.py @@ -13,6 +13,12 @@ from functional.run import write_json MODES = ('native', 'direct', 'linear', 'lisa', 'lisa_answer_weighted') +def paired_interval(delta): + rng = np.random.default_rng(415006) + draw = rng.integers(0, len(delta), size=(10000, len(delta))) + return np.quantile(delta[draw].mean(1), [.025, .975]).tolist() + + def paired(native, direct, candidate): damaged = native & ~direct rescued = damaged & candidate @@ -20,9 +26,6 @@ def paired(native, direct, candidate): candidate_only = ~direct & candidate direct_only = direct & ~candidate delta = candidate.astype(int) - direct.astype(int) - rng = np.random.default_rng(415006) - draw = rng.integers(0, len(delta), size=(10000, len(delta))) - ci = np.quantile(delta[draw].mean(1), [.025, .975]) a, b = int(candidate_only.sum()), int(direct_only.sum()) k = a + b p = min(1., 2. * sum(math.comb(k, i) for i in range(min(a, b)+1)) / 2**k) @@ -30,10 +33,61 @@ def paired(native, direct, candidate): 'newly_lost_among_native_and_direct_correct': int(newly_lost.sum()), 'candidate_correct_direct_wrong': a, 'direct_correct_candidate_wrong': b, 'accuracy_delta_vs_direct': float(delta.mean()), - 'paired_prompt_bootstrap_95': ci.tolist(), 'mcnemar_exact_p': p} + 'paired_prompt_bootstrap_95': paired_interval(delta), 'mcnemar_exact_p': p} -def audit(fixed, selection, items, perf=None, decode=None): +def loss_delta(losses, baseline): + delta = losses - baseline + return {'mean_delta': float(delta.mean()), 'paired_prompt_bootstrap_95': paired_interval(delta)} + + +def full_vocab_metrics(path, expected, sites, choices): + report = json.loads(path.read_text()) + chain = len(sites) > 1 + if (report['candidate_sites'] != sites + or report['single_lisa_is_ablation_of_joint_checkpoint'] != chain): + raise ValueError('Full-vocabulary layers differ from the locked schedule') + arms = report['arms'] + mapped = {'native': 'native', 'linear': 'linear', 'lisa_answer_weighted': 'lisa_answer_weighted', + 'direct_chain' if chain else 'direct_23': 'direct', + 'lisa_chain' if chain else 'lisa_23_ablation': 'lisa'} + if set(arms) != set(mapped) | {'direct_23', 'lisa_23_ablation'}: + raise ValueError('Unexpected full-vocabulary arms') + expected_ids = [name for name, _ in expected] + correct, nll = {}, {} + gold_ids = [row['gold_id'] for row in arms['native']['rows']] + for mode, summary in arms.items(): + rows = summary['rows'] + if (summary['n'] != len(expected_ids) or [row['id'] for row in rows] != expected_ids + or [row['gold_id'] for row in rows] != gold_ids): + raise ValueError(f'{mode} vocabulary result does not match the locked rows') + correct[mode] = np.array([row['greedy_id'] == row['gold_id'] for row in rows]) + nll[mode] = np.array([row['nll'] for row in rows]) + choice_correct = np.array([row['choice_id'] == row['gold_id'] for row in rows]) + if (not np.isfinite(nll[mode]).all() or (nll[mode] < 0).any() + or int(correct[mode].sum()) != summary['full_vocab_correct'] + or int(choice_correct.sum()) != summary['four_choice_correct'] + or not np.isclose(nll[mode].mean(), summary['full_vocab_nll'])): + raise ValueError(f'Invalid vocabulary metrics for {mode}') + if mode in mapped and not np.array_equal(choice_correct, choices[mapped[mode]]): + raise ValueError(f'{mode} choices differ across the two evaluations') + matches = {'lisa_23_ablation': 'direct_23', + 'native': 'direct_chain' if chain else 'direct_23', + 'linear': 'direct_chain' if chain else 'direct_23', + 'lisa_answer_weighted': 'direct_chain' if chain else 'direct_23'} + if chain: + matches['lisa_chain'] = 'direct_chain' + return { + 'arms': {mode: {'correct': int(correct[mode].sum()), 'answer_nll': float(nll[mode].mean())} + for mode in arms}, + 'matched_direct_comparisons': { + mode: {'baseline': direct, 'answer_nll_delta': loss_delta(nll[mode], nll[direct]), + **paired(correct['native'], correct[direct], correct[mode])} + for mode, direct in matches.items()}, + } + + +def audit(fixed, selection, items, perf=None, decode=None, full_vocab=None): spec = json.loads(selection.read_text()) if hashlib.sha256(fixed.read_bytes()).hexdigest() != spec['fixed_problems_sha256']: raise ValueError('Fixed problems provenance mismatch') @@ -44,7 +98,7 @@ def audit(fixed, selection, items, perf=None, decode=None): if set(data) != set(MODES) or not expected: raise ValueError('Unexpected test arms or empty selected split') correct = {} - mean_losses = {} + losses = {} for mode, rows in data.items(): if [(r['id'], r['gold']) for r in rows] != expected: raise ValueError(f'{mode} result does not match the locked challenge') @@ -56,9 +110,11 @@ def audit(fixed, selection, items, perf=None, decode=None): or not np.array_equal(logits.argmax(1), pred)): raise ValueError(f'Invalid choice scores for {mode}') np.testing.assert_allclose(nll, [row['answer_nll'] for row in rows], atol=3e-6, rtol=2e-6) - correct[mode], mean_losses[mode] = pred == gold, float(nll.mean()) + correct[mode], losses[mode] = pred == gold, nll metrics = {'selected_task': task, 'sites': spec['sites'], 'n': len(expected), - 'arms': {mode: {'correct': int(correct[mode].sum()), 'answer_nll_4': mean_losses[mode], + 'arms': {mode: {'correct': int(correct[mode].sum()), + 'answer_nll_4': float(losses[mode].mean()), + 'answer_nll_4_vs_direct': loss_delta(losses[mode], losses['direct']), **paired(correct['native'], correct['direct'], correct[mode])} for mode in MODES}} if perf: @@ -80,6 +136,8 @@ def audit(fixed, selection, items, perf=None, decode=None): 'median_s_per_token': times, 'measured_kv_bytes': {'native': native, 'lisa': lisa}, 'lisa_upstream_score_row_bytes': nn, 'recipient_bytes_delta': lisa+nn-native, } + if full_vocab: + metrics['full_vocab'] = full_vocab_metrics(full_vocab, expected, spec['sites'], correct) return metrics @@ -89,8 +147,9 @@ def main(): parser.add_argument('--'+name, type=Path, required=True) parser.add_argument('--perf', type=Path) parser.add_argument('--decode', type=Path) + parser.add_argument('--full-vocab', type=Path) a = parser.parse_args() - report = audit(a.fixed, a.selection, a.items, a.perf, a.decode) + report = audit(a.fixed, a.selection, a.items, a.perf, a.decode, a.full_vocab) write_json(a.out, report) diff --git a/docs/LISA_EFFECT_PROTOCOL.md b/docs/LISA_EFFECT_PROTOCOL.md index 7765511..70f4d30 100644 --- a/docs/LISA_EFFECT_PROTOCOL.md +++ b/docs/LISA_EFFECT_PROTOCOL.md @@ -125,14 +125,17 @@ RESULT=runs/NEW_EFFECT_RESULT --trained "$RESULT" --out "$RESULT/full-vocab-answers.json" "$PYTHON" -B -m crossqkv.lisa_effect_audit --fixed "$SCREEN/fixed-problems.json" \ --selection "$CAPTURE/selection.json" --items "$RESULT/test-items.json" \ - --perf "$RESULT/performance.json" --decode "$RESULT/decode.json" --out "$RESULT/paired-audit.json" + --perf "$RESULT/performance.json" --decode "$RESULT/decode.json" \ + --full-vocab "$RESULT/full-vocab-answers.json" --out "$RESULT/paired-audit.json" ``` The paired audit defines a rescue as a native-correct item made wrong by direct sharing and made correct again by the tested adapter. It reports newly lost native-and-direct-correct items separately. An improvement in mean four-option answer NLL, including among items already answered -correctly, does not by itself establish a rescue. +correctly, does not by itself establish a rescue. The audit computes paired +intervals for NLL differences and checks that common arms have identical +four-choice correctness in the primary test and the full-vocabulary pass. Training scores *all* valid shifted tokens with exact full-vocabulary CE and uses the validation four-option answer loss to freeze checkpoints. The diff --git a/results/lisa-effect-reproduction/runtime.json b/results/lisa-effect-reproduction/runtime.json index 299566e..e459142 100644 --- a/results/lisa-effect-reproduction/runtime.json +++ b/results/lisa-effect-reproduction/runtime.json @@ -35,6 +35,15 @@ "validated_remote_benchmark_sha256": "979e566a3391b9418b49beb10c200a48aac706ee95c145510850c929bcc2885a", "reason": "Measure compute with resident projections separately from streamed execution", "remote_numeric_tests": "4 passed; resident projection outputs compared with streamed output" + }, + "lisa_effect_audit.py": { + "verified_audit_sha256": "2d7feb79c23bed05d4d961ead7cbdfcff61b5425f1c3ef88192c2c3cd5afecb4", + "reason": "Cross-check the four-choice arms against the full-vocabulary pass and quantify paired answer-loss changes", + "remote_numeric_tests": "4 passed in an isolated source directory", + "outputs": { + "paired-audit.json": "original audit hash in audit_code_sha256", + "verified-audit.json": "verified_audit_sha256" + } } } } diff --git a/tests/test_lisa_effect_audit.py b/tests/test_lisa_effect_audit.py index dfd10c9..86c0c2f 100644 --- a/tests/test_lisa_effect_audit.py +++ b/tests/test_lisa_effect_audit.py @@ -1,4 +1,7 @@ """Check answer-only metrics and isolate recovery from newly lost items.""" +import json +from pathlib import Path +from tempfile import TemporaryDirectory import unittest import numpy as np @@ -6,11 +9,44 @@ import torch from torch.nn import functional as F from crossqkv.lisa_effect_answer_audit import vocabulary_scores -from crossqkv.lisa_effect_audit import paired +from crossqkv.lisa_effect_audit import MODES, full_vocab_metrics, loss_delta, paired from tests.test_lisa_tail import Tensor class EffectAuditTests(unittest.TestCase): + def test_loss_interval_uses_paired_differences(self): + direct = np.array([0.5, 1.0, 4.0, 9.0]) + result = loss_delta(direct - 0.25, direct) + self.assertEqual(result, {'mean_delta': -0.25, + 'paired_prompt_bootstrap_95': [-0.25, -0.25]}) + + def test_full_vocab_compares_each_recipient_schedule_to_matched_direct(self): + mapped = ('native', 'linear', 'direct_chain', 'lisa_chain', 'lisa_answer_weighted', + 'direct_23', 'lisa_23_ablation') + payload = {'candidate_sites': [19, 23], 'single_lisa_is_ablation_of_joint_checkpoint': True, + 'arms': {}} + for name in mapped: + correct = name not in ('direct_chain', 'direct_23') + payload['arms'][name] = { + 'n': 1, 'full_vocab_correct': int(correct), 'four_choice_correct': 1, + 'full_vocab_nll': 0.25 if correct else 2.0, + 'rows': [{'id': 'test-a', 'gold_id': 3, 'greedy_id': 3 if correct else 4, + 'choice_id': 3, 'nll': 0.25 if correct else 2.0}], + } + choices = {name: np.array([True]) for name in MODES} + with TemporaryDirectory() as scratch: + path = Path(scratch) / 'answers.json' + path.write_text(json.dumps(payload)) + measured = full_vocab_metrics(path, [('test-a', 0)], [19, 23], choices) + comparisons = measured['matched_direct_comparisons'] + self.assertEqual(comparisons['lisa_chain']['baseline'], 'direct_chain') + self.assertEqual(comparisons['lisa_23_ablation']['baseline'], 'direct_23') + self.assertEqual(comparisons['lisa_chain']['rescued'], 1) + self.assertEqual(comparisons['lisa_chain']['answer_nll_delta']['mean_delta'], -1.75) + choices['lisa'] = np.array([False]) + with self.assertRaisesRegex(ValueError, 'lisa_chain choices differ'): + full_vocab_metrics(path, [('test-a', 0)], [19, 23], choices) + def test_paired_rescue_excludes_natively_wrong_items(self): native, direct, candidate = (np.array(x, dtype=bool) for x in [(1, 1, 1, 0), (0, 0, 1, 1), (1, 0, 0, 1)]) -- 2.52.0 From c2aa23f32fb3d1b750ee2d65bf82ea237a924ca2 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 01:16:08 +0800 Subject: [PATCH 3/4] Record LiSA task and CPU performance results --- docs/LISA_EFFECT_PROTOCOL.md | 19 +- docs/LISA_EFFECT_RESULTS.md | 31 + results/lisa-effect-reproduction/decode.json | 141 ++ .../lisa-effect-reproduction/performance.json | 28 + results/lisa-effect-reproduction/runtime.json | 29 + .../lisa-effect-reproduction/test-items.json | 1932 +++++++++++++++++ results/lisa-effect-reproduction/trace.json | 38 + .../train-protocol.json | 21 + 8 files changed, 2235 insertions(+), 4 deletions(-) create mode 100644 docs/LISA_EFFECT_RESULTS.md create mode 100644 results/lisa-effect-reproduction/decode.json create mode 100644 results/lisa-effect-reproduction/performance.json create mode 100644 results/lisa-effect-reproduction/test-items.json create mode 100644 results/lisa-effect-reproduction/trace.json create mode 100644 results/lisa-effect-reproduction/train-protocol.json diff --git a/docs/LISA_EFFECT_PROTOCOL.md b/docs/LISA_EFFECT_PROTOCOL.md index 70f4d30..8ad065c 100644 --- a/docs/LISA_EFFECT_PROTOCOL.md +++ b/docs/LISA_EFFECT_PROTOCOL.md @@ -12,10 +12,17 @@ At the same 22 layers, direct score sharing retained 46.76% and the direct sharing plus LoRA baseline retained 65.95%. The published main uptraining used 4.2 billion sampled RedPajama tokens on eight A800 GPUs. This experiment uses a frozen Qwen3.5-2B backbone, two recipient layers, 12 synthetic fit -prompts and a single CPU runner. The comparable effect is an improvement -over direct sharing under a fixed layer schedule. The magnitude on a -32-item lookup test and the timing of CPU attention should be interpreted -within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf) +prompts and a single CPU runner. Each epoch of the trainable variants sees +1,874 next-token targets drawn from those same 12 prompts. The comparable +effect is an improvement over direct sharing under a fixed layer schedule. +The magnitude on a 32-item lookup test and the timing of CPU attention should +be interpreted within those settings. [Mu et al., Table 2 and Appendix C.1](https://aclanthology.org/2026.tacl-1.30.pdf) + +Qwen's text decoder has six full-attention layers and 18 linear-attention +layers. The chained configuration modifies two of the six full-attention +layers and two of the 24 decoder layers overall. Layer numbers are zero-based. +The source record in `results/lisa-effect-reproduction/runtime.json` pins +the original model revision, the checkpoint shard and its download-manifest hash. ## Task and layer screening @@ -140,6 +147,10 @@ four-choice correctness in the primary test and the full-vocabulary pass. Training scores *all* valid shifted tokens with exact full-vocabulary CE and uses the validation four-option answer loss to freeze checkpoints. The answer audit scores only the answer position over the whole vocabulary. +The answer is one token per prompt. In the fit set, it accounts for about +0.64% of the unweighted CE target mass and about 9.35% with the 16-fold answer +weight. The objective applies the same 0.75 coefficient to the resulting +mean CE in both trainable variants. It does not report whole-prompt CE for the held-out items or free-form multi-token answer accuracy. That distinction is important for interpreting the previous experiment, in which those two losses moved in opposite diff --git a/docs/LISA_EFFECT_RESULTS.md b/docs/LISA_EFFECT_RESULTS.md new file mode 100644 index 0000000..c2e2aad --- /dev/null +++ b/docs/LISA_EFFECT_RESULTS.md @@ -0,0 +1,31 @@ +# Qwen3.5-2B 双层 LiSA 复现实验 + +在固定的 32 道查找题上,原模型、直接共享、线性修正和两版 LiSA 都答对 32 道。原版 LiSA 降低了接收层 K/V 缓存,并在投影权重常驻内存时缩短了两个接收层的单步解码时间。按本次 CPU 权重流式读取方式测量,第 19 层单步解码更快,第 23 层略慢,双层共享的预填充更慢。全词表答案复核正在运行。 + +## 四选一任务表现 + +开发筛选中,原模型和单层直接共享各答对 8/8,双层直接共享答对 7/8。以此冻结 16 条目查找任务,测试使用独立题目。共享链为 15→19→23,层号从 0 起算。第 19、23 层占 6 个全注意力层的三分之一,占 24 个解码层的十二分之一。 + +| 方法 | 留出正确数 | 四选一答案 NLL ↓ | +| --- | ---: | ---: | +| 原模型 | 32/32 | 0.1341 | +| 双层直接共享 | 32/32 | 0.0728 | +| 双层线性修正 | 32/32 | 0.0720 | +| 双层 LiSA | 32/32 | 0.1846 | +| 双层 LiSA,答案损失加权 | 32/32 | 0.1260 | + +直接共享在留出集上丢失 0 道原模型答对的题,因此无法估计 LiSA 对这类错题的恢复率。答案加权把 LiSA 的四选一 NLL 降低了 0.0586,仍高于直接共享。三种训练方法各用 12 道拟合题跑两轮,并由另外 12 道验证题选择检查点。所选检查点都是第 2 轮。逐题 logits、训练轨迹及检查点哈希随结果归档。 + +## CPU 计时和缓存 + +| 测量范围 | 原模型 | LiSA | +| --- | ---: | ---: | +| 缓存前缀后的尾部预填充,157 tokens | 12.37 s | 16.31 s | +| 第 19 层单步,流式读取权重 | 136.15 ms | 96.32 ms | +| 第 23 层单步,流式读取权重 | 136.39 ms | 138.80 ms | +| 第 19 层单步,投影权重常驻 | 42.57 ms | 32.09 ms | +| 第 23 层单步,投影权重常驻 | 44.80 ms | 22.79 ms | + +每个接收层的 FP32 K/V 实际分配从 643,072 降到 371,776 字节,下降 42.2%。计入该层所用的 5,024 字节上游分数行后,单层合计下降 41.4%。V 缓存为 321,536 字节。解码计时的单位是单个接收层的一步,计时范围从接收现成分数行开始,至该层注意力输出结束。预填充用 3 次计时的中位数,单层解码每个配置用 9 步计时的中位数。 + +论文表 2 的 96.44% 衡量 LLaMA2-13B 在共享 22 层时多个基准上的平均性能保留率。这里每轮只有 1,874 个训练目标 token,测到的是单一查找任务的表现和 CPU 组件耗时。 [论文表 2、表 3 和附录 C.1](https://aclanthology.org/2026.tacl-1.30.pdf) diff --git a/results/lisa-effect-reproduction/decode.json b/results/lisa-effect-reproduction/decode.json new file mode 100644 index 0000000..5a5a8cf --- /dev/null +++ b/results/lisa-effect-reproduction/decode.json @@ -0,0 +1,141 @@ +{ + "scope": "isolated full-attention recipient, FP32, frozen true activations; excludes donor generation and full-model decode", + "sites": { + "19": { + "seconds_per_token": { + "native": [ + 0.13286287058144808, + 0.1361464262008667, + 0.12924433965235949, + 0.1288278056308627, + 0.13502545654773712, + 0.14447933342307806, + 0.21267611254006624, + 0.19696053490042686, + 0.17250606417655945 + ], + "lisa": [ + 0.0882081063464284, + 0.0963163236156106, + 0.0912644388154149, + 0.09147092420607805, + 0.09272865019738674, + 0.11763023491948843, + 0.09996491950005293, + 0.11747161205857992, + 0.11429349146783352 + ] + }, + "resident_seconds_per_token": { + "native": [ + 0.03415969293564558, + 0.030925235711038113, + 0.03575391788035631, + 0.04256666451692581, + 0.04327994678169489, + 0.0476421257480979, + 0.04229569900780916, + 0.04316695313900709, + 0.04567800182849169 + ], + "lisa": [ + 0.041921489872038364, + 0.04422656074166298, + 0.03127973526716232, + 0.03182042483240366, + 0.03665950056165457, + 0.03138743154704571, + 0.028396621346473694, + 0.037525477819144726, + 0.03209121432155371 + ] + }, + "resident_median_s_per_token": { + "native": 0.04256666451692581, + "lisa": 0.03209121432155371 + }, + "resident_matches_streamed": true, + "allocated_bytes": { + "native": { + "k": 321536, + "v": 321536 + }, + "lisa": { + "k": 50240, + "v": 321536 + } + }, + "lisa_input_score_row_bytes": 5024, + "sequence_length": 157 + }, + "23": { + "seconds_per_token": { + "native": [ + 0.1291032126173377, + 0.12674292363226414, + 0.1282597053796053, + 0.13638535235077143, + 0.1298640752211213, + 0.1457589939236641, + 0.20920543558895588, + 0.20562185905873775, + 0.19381640758365393 + ], + "lisa": [ + 0.14143545273691416, + 0.08705597650259733, + 0.08696427289396524, + 0.1120216203853488, + 0.1387955490499735, + 0.13695972133427858, + 0.14612034149467945, + 0.1524249343201518, + 0.1556852562353015 + ] + }, + "resident_seconds_per_token": { + "native": [ + 0.04479535948485136, + 0.04507693089544773, + 0.04067131970077753, + 0.04552943166345358, + 0.05950945522636175, + 0.05104204546660185, + 0.03087245672941208, + 0.03152573574334383, + 0.03583979792892933 + ], + "lisa": [ + 0.022208196111023426, + 0.021793252788484097, + 0.03165019955486059, + 0.025800297036767006, + 0.022528269328176975, + 0.022276684641838074, + 0.02320440299808979, + 0.0227946899831295, + 0.024175109341740608 + ] + }, + "resident_median_s_per_token": { + "native": 0.04479535948485136, + "lisa": 0.0227946899831295 + }, + "resident_matches_streamed": true, + "allocated_bytes": { + "native": { + "k": 321536, + "v": 321536 + }, + "lisa": { + "k": 50240, + "v": 321536 + } + }, + "lisa_input_score_row_bytes": 5024, + "sequence_length": 157 + } + }, + "streamed_timings_include_weight_reads": true, + "resident_timings_exclude_projection_load": true +} diff --git a/results/lisa-effect-reproduction/performance.json b/results/lisa-effect-reproduction/performance.json new file mode 100644 index 0000000..8463a54 --- /dev/null +++ b/results/lisa-effect-reproduction/performance.json @@ -0,0 +1,28 @@ +{ + "scope": "cached-prefix last layers, prefill", + "seconds": { + "native": [ + 11.3411781527102, + 12.700857263058424, + 12.369724708609283 + ], + "direct": [ + 11.017615622840822, + 10.737364768981934, + 11.625513913109899 + ], + "lisa": [ + 15.469715679064393, + 16.857490073889494, + 16.311319678090513 + ] + }, + "real_tokens": 157, + "cache_estimate": { + "scope": "formula for one sequence, BF16 keys and score buffers", + "native_recipient_key_bytes": 321536, + "lisa_recipient_key_bytes": 50240, + "one_shared_decode_score_row_bytes": 2512, + "one_full_prefill_score_matrix_bytes": 394384 + } +} diff --git a/results/lisa-effect-reproduction/runtime.json b/results/lisa-effect-reproduction/runtime.json index e459142..b07d71d 100644 --- a/results/lisa-effect-reproduction/runtime.json +++ b/results/lisa-effect-reproduction/runtime.json @@ -7,6 +7,35 @@ "numpy": "2.5.4", "torch": "2.15.0+cpu", "tokenizers": "0.23.3", + "model_source": { + "repository": "Qwen/Qwen3.5-2B", + "revision": "15852e8c16360a2fea060d615a32b45270f8a8fc", + "manifest_sha256": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de", + "weight_shard": { + "name": "model.safetensors-00001-of-00001.safetensors", + "bytes": 4548221488, + "sha256_in_download_manifest": "aa33250c4fc64891ddfaba3a314fd9542ea371843c387178b425fbcc5ed680b1" + }, + "decoder_layers": 24, + "linear_attention_layers": 18, + "full_attention_layers_zero_based": [3, 7, 11, 15, 19, 23], + "query_heads": 8, + "key_value_heads": 2, + "native_head_dimension": 256, + "hidden_size": 2048, + "vocabulary_size": 248320 + }, + "capture_sizes": { + "fit": {"prompts": 12, "input_tokens": 1886, "shifted_target_tokens": 1874, "min_input_tokens": 155, "median_input_tokens": 157.5, "max_input_tokens": 158}, + "validation": {"prompts": 12, "input_tokens": 1882, "shifted_target_tokens": 1870, "min_input_tokens": 154, "median_input_tokens": 157.0, "max_input_tokens": 160}, + "test": {"prompts": 32, "input_tokens": 5017, "shifted_target_tokens": 4985, "min_input_tokens": 153, "median_input_tokens": 157.0, "max_input_tokens": 159} + }, + "validation_selected_checkpoints": { + "trace_sha256": "b432fba669d45c09634e96498a15f9d93f971d1ee2b67a826d6f8bc979525866", + "linear.pt": {"epoch": 2, "sha256": "cf204dc784a925de69faa8bed0789ef42877204edb9537d914486d39518fe8ce"}, + "lisa.pt": {"epoch": 2, "sha256": "358272c5eb90cea9e3ed006b2c75a4bcd7f5db4f857982e078dd7f71c6c46c5b"}, + "lisa_answer_weighted.pt": {"epoch": 2, "sha256": "2b384d5618c190b29bdbb1bc0151c1eb64e1699e209a50ed8171a2d"} + }, "main_code_sha256": { "lisa_effect.py": "8a3ecad71f23e3e8b8faf4a7c21c0c93f00fd0bffe14bdee6117921b548dce8a", "lisa_tail.py": "4bd2c3c8690a8ae30cc1a9573ec17b7bbe25edf43a33507482719dc03cfeb9af", diff --git a/results/lisa-effect-reproduction/test-items.json b/results/lisa-effect-reproduction/test-items.json new file mode 100644 index 0000000..43e864e --- /dev/null +++ b/results/lisa-effect-reproduction/test-items.json @@ -0,0 +1,1932 @@ +{ + "native": [ + { + "id": "test-lookup16-000", + "gold": 0, + "logits": [ + 20.85590362548828, + 17.182701110839844, + 15.405997276306152, + 16.56983184814453 + ], + "pred": 0, + "answer_nll": 0.04253387451171875 + }, + { + "id": "test-lookup16-001", + "gold": 3, + "logits": [ + 16.71235466003418, + 16.39767074584961, + 16.63048553466797, + 19.901031494140625 + ], + "pred": 3, + "answer_nll": 0.10373687744140625 + }, + { + "id": "test-lookup16-002", + "gold": 0, + "logits": [ + 20.092655181884766, + 17.498620986938477, + 15.969141960144043, + 17.709365844726562 + ], + "pred": 0, + "answer_nll": 0.168182373046875 + }, + { + "id": "test-lookup16-003", + "gold": 1, + "logits": [ + 18.19259262084961, + 20.460416793823242, + 15.979042053222656, + 16.065513610839844 + ], + "pred": 1, + "answer_nll": 0.11973190307617188 + }, + { + "id": "test-lookup16-004", + "gold": 1, + "logits": [ + 18.19254493713379, + 20.924468994140625, + 16.695392608642578, + 18.369831085205078 + ], + "pred": 1, + "answer_nll": 0.14615821838378906 + }, + { + "id": "test-lookup16-005", + "gold": 1, + "logits": [ + 17.819522857666016, + 20.409072875976562, + 17.45224380493164, + 16.268949508666992 + ], + "pred": 1, + "answer_nll": 0.1336193084716797 + }, + { + "id": "test-lookup16-006", + "gold": 0, + "logits": [ + 20.719379425048828, + 16.701087951660156, + 15.611319541931152, + 17.011600494384766 + ], + "pred": 0, + "answer_nll": 0.047420501708984375 + }, + { + "id": "test-lookup16-007", + "gold": 2, + "logits": [ + 17.0794677734375, + 16.867019653320312, + 20.172761917114258, + 16.6821231842041 + ], + "pred": 2, + "answer_nll": 0.10661506652832031 + }, + { + "id": "test-lookup16-008", + "gold": 3, + "logits": [ + 17.34001922607422, + 16.78146743774414, + 17.975500106811523, + 20.643951416015625 + ], + "pred": 3, + "answer_nll": 0.119659423828125 + }, + { + "id": "test-lookup16-009", + "gold": 0, + "logits": [ + 21.178791046142578, + 18.079408645629883, + 16.946470260620117, + 18.40373992919922 + ], + "pred": 0, + "answer_nll": 0.11506080627441406 + }, + { + "id": "test-lookup16-010", + "gold": 1, + "logits": [ + 17.847366333007812, + 20.291475296020508, + 17.038164138793945, + 16.603261947631836 + ], + "pred": 1, + "answer_nll": 0.140167236328125 + }, + { + "id": "test-lookup16-011", + "gold": 0, + "logits": [ + 21.102188110351562, + 18.751220703125, + 16.86586570739746, + 16.875581741333008 + ], + "pred": 0, + "answer_nll": 0.11719512939453125 + }, + { + "id": "test-lookup16-012", + "gold": 3, + "logits": [ + 17.15856170654297, + 16.803720474243164, + 16.676246643066406, + 20.17314338684082 + ], + "pred": 3, + "answer_nll": 0.10774803161621094 + }, + { + "id": "test-lookup16-013", + "gold": 0, + "logits": [ + 20.968936920166016, + 17.956104278564453, + 16.823535919189453, + 18.676280975341797 + ], + "pred": 0, + "answer_nll": 0.15356826782226562 + }, + { + "id": "test-lookup16-014", + "gold": 0, + "logits": [ + 21.061098098754883, + 17.67755126953125, + 17.25188446044922, + 17.832218170166016 + ], + "pred": 0, + "answer_nll": 0.09138870239257812 + }, + { + "id": "test-lookup16-015", + "gold": 1, + "logits": [ + 18.43671417236328, + 21.12980079650879, + 16.933246612548828, + 16.55162811279297 + ], + "pred": 1, + "answer_nll": 0.08891868591308594 + }, + { + "id": "test-lookup16-016", + "gold": 3, + "logits": [ + 17.535999298095703, + 17.16307258605957, + 17.97173500061035, + 20.522735595703125 + ], + "pred": 3, + "answer_nll": 0.15117645263671875 + }, + { + "id": "test-lookup16-017", + "gold": 3, + "logits": [ + 17.704940795898438, + 17.205245971679688, + 16.638643264770508, + 19.97443962097168 + ], + "pred": 3, + "answer_nll": 0.18370628356933594 + }, + { + "id": "test-lookup16-018", + "gold": 1, + "logits": [ + 18.743724822998047, + 21.02330780029297, + 17.126293182373047, + 17.16258430480957 + ], + "pred": 1, + "answer_nll": 0.13425254821777344 + }, + { + "id": "test-lookup16-019", + "gold": 2, + "logits": [ + 17.654508590698242, + 17.452632904052734, + 20.551685333251953, + 16.962116241455078 + ], + "pred": 2, + "answer_nll": 0.12034034729003906 + }, + { + "id": "test-lookup16-020", + "gold": 1, + "logits": [ + 18.674922943115234, + 20.26547622680664, + 17.111343383789062, + 16.82799530029297 + ], + "pred": 1, + "answer_nll": 0.24579238891601562 + }, + { + "id": "test-lookup16-021", + "gold": 2, + "logits": [ + 17.741802215576172, + 17.225322723388672, + 20.360462188720703, + 17.311702728271484 + ], + "pred": 2, + "answer_nll": 0.1517009735107422 + }, + { + "id": "test-lookup16-022", + "gold": 3, + "logits": [ + 17.583019256591797, + 16.546951293945312, + 17.961929321289062, + 20.2408504486084 + ], + "pred": 3, + "answer_nll": 0.18012619018554688 + }, + { + "id": "test-lookup16-023", + "gold": 2, + "logits": [ + 17.424779891967773, + 17.140159606933594, + 20.513261795043945, + 16.285972595214844 + ], + "pred": 2, + "answer_nll": 0.09024810791015625 + }, + { + "id": "test-lookup16-024", + "gold": 3, + "logits": [ + 17.562179565429688, + 16.624563217163086, + 16.99336814880371, + 20.001056671142578 + ], + "pred": 3, + "answer_nll": 0.15771484375 + }, + { + "id": "test-lookup16-025", + "gold": 1, + "logits": [ + 19.013219833374023, + 20.628419876098633, + 16.340301513671875, + 15.84334945678711 + ], + "pred": 1, + "answer_nll": 0.1996173858642578 + }, + { + "id": "test-lookup16-026", + "gold": 2, + "logits": [ + 17.605148315429688, + 17.381399154663086, + 19.99165153503418, + 17.225971221923828 + ], + "pred": 2, + "answer_nll": 0.20571327209472656 + }, + { + "id": "test-lookup16-027", + "gold": 2, + "logits": [ + 17.09252166748047, + 16.869815826416016, + 19.97600555419922, + 16.07839584350586 + ], + "pred": 2, + "answer_nll": 0.11422157287597656 + }, + { + "id": "test-lookup16-028", + "gold": 2, + "logits": [ + 17.679317474365234, + 16.862308502197266, + 20.042417526245117, + 16.65038299560547 + ], + "pred": 2, + "answer_nll": 0.1564464569091797 + }, + { + "id": "test-lookup16-029", + "gold": 3, + "logits": [ + 17.080469131469727, + 16.263690948486328, + 17.81536102294922, + 20.025781631469727 + ], + "pred": 3, + "answer_nll": 0.17014312744140625 + }, + { + "id": "test-lookup16-030", + "gold": 0, + "logits": [ + 20.95917510986328, + 17.862529754638672, + 16.560611724853516, + 17.46575164794922 + ], + "pred": 0, + "answer_nll": 0.08424186706542969 + }, + { + "id": "test-lookup16-031", + "gold": 2, + "logits": [ + 18.012731552124023, + 16.561927795410156, + 20.195032119750977, + 16.112499237060547 + ], + "pred": 2, + "answer_nll": 0.1450347900390625 + } + ], + "direct": [ + { + "id": "test-lookup16-000", + "gold": 0, + "logits": [ + 20.705219268798828, + 17.267292022705078, + 15.242891311645508, + 15.892521858215332 + ], + "pred": 0, + "answer_nll": 0.04353904724121094 + }, + { + "id": "test-lookup16-001", + "gold": 3, + "logits": [ + 15.36229419708252, + 15.271305084228516, + 15.334710121154785, + 19.6867618560791 + ], + "pred": 3, + "answer_nll": 0.03749847412109375 + }, + { + "id": "test-lookup16-002", + "gold": 0, + "logits": [ + 19.671100616455078, + 17.571245193481445, + 15.751747131347656, + 17.015933990478516 + ], + "pred": 0, + "answer_nll": 0.192779541015625 + }, + { + "id": "test-lookup16-003", + "gold": 1, + "logits": [ + 17.178115844726562, + 20.500694274902344, + 15.529312133789062, + 14.840266227722168 + ], + "pred": 1, + "answer_nll": 0.04542732238769531 + }, + { + "id": "test-lookup16-004", + "gold": 1, + "logits": [ + 17.16912841796875, + 20.932100296020508, + 15.759957313537598, + 16.415515899658203 + ], + "pred": 1, + "answer_nll": 0.03904151916503906 + }, + { + "id": "test-lookup16-005", + "gold": 1, + "logits": [ + 16.946626663208008, + 20.062686920166016, + 16.527233123779297, + 15.397865295410156 + ], + "pred": 1, + "answer_nll": 0.07964134216308594 + }, + { + "id": "test-lookup16-006", + "gold": 0, + "logits": [ + 20.07964324951172, + 16.427297592163086, + 15.712325096130371, + 16.411008834838867 + ], + "pred": 0, + "answer_nll": 0.06215476989746094 + }, + { + "id": "test-lookup16-007", + "gold": 2, + "logits": [ + 15.306232452392578, + 15.356870651245117, + 19.725595474243164, + 15.29250717163086 + ], + "pred": 2, + "answer_nll": 0.0359344482421875 + }, + { + "id": "test-lookup16-008", + "gold": 3, + "logits": [ + 15.837872505187988, + 15.134496688842773, + 16.550796508789062, + 20.279632568359375 + ], + "pred": 3, + "answer_nll": 0.04078102111816406 + }, + { + "id": "test-lookup16-009", + "gold": 0, + "logits": [ + 21.142356872558594, + 18.036365509033203, + 17.400279998779297, + 17.60244369506836 + ], + "pred": 0, + "answer_nll": 0.09303474426269531 + }, + { + "id": "test-lookup16-010", + "gold": 1, + "logits": [ + 16.95785903930664, + 20.111740112304688, + 16.392375946044922, + 15.836536407470703 + ], + "pred": 1, + "answer_nll": 0.0777435302734375 + }, + { + "id": "test-lookup16-011", + "gold": 0, + "logits": [ + 20.403419494628906, + 18.50678253173828, + 17.424747467041016, + 16.214834213256836 + ], + "pred": 0, + "answer_nll": 0.1956501007080078 + }, + { + "id": "test-lookup16-012", + "gold": 3, + "logits": [ + 16.080984115600586, + 15.748584747314453, + 15.034163475036621, + 19.727663040161133 + ], + "pred": 3, + "answer_nll": 0.05253028869628906 + }, + { + "id": "test-lookup16-013", + "gold": 0, + "logits": [ + 20.43213653564453, + 17.821496963500977, + 16.465965270996094, + 18.407695770263672 + ], + "pred": 0, + "answer_nll": 0.20253372192382812 + }, + { + "id": "test-lookup16-014", + "gold": 0, + "logits": [ + 20.72513198852539, + 17.450183868408203, + 16.73740005493164, + 17.69377899169922 + ], + "pred": 0, + "answer_nll": 0.09949302673339844 + }, + { + "id": "test-lookup16-015", + "gold": 1, + "logits": [ + 17.535215377807617, + 21.245311737060547, + 15.612133026123047, + 15.40495777130127 + ], + "pred": 1, + "answer_nll": 0.030490875244140625 + }, + { + "id": "test-lookup16-016", + "gold": 3, + "logits": [ + 15.992125511169434, + 15.782687187194824, + 17.17706298828125, + 20.359180450439453 + ], + "pred": 3, + "answer_nll": 0.0624847412109375 + }, + { + "id": "test-lookup16-017", + "gold": 3, + "logits": [ + 16.19760513305664, + 16.358436584472656, + 15.497957229614258, + 19.31939697265625 + ], + "pred": 3, + "answer_nll": 0.1113128662109375 + }, + { + "id": "test-lookup16-018", + "gold": 1, + "logits": [ + 17.293609619140625, + 20.595457077026367, + 14.670961380004883, + 14.199273109436035 + ], + "pred": 1, + "answer_nll": 0.04033088684082031 + }, + { + "id": "test-lookup16-019", + "gold": 2, + "logits": [ + 15.734247207641602, + 15.453847885131836, + 20.570484161376953, + 15.290510177612305 + ], + "pred": 2, + "answer_nll": 0.018846511840820312 + }, + { + "id": "test-lookup16-020", + "gold": 1, + "logits": [ + 17.764366149902344, + 19.95705795288086, + 15.956869125366211, + 15.494156837463379 + ], + "pred": 1, + "answer_nll": 0.13230514526367188 + }, + { + "id": "test-lookup16-021", + "gold": 2, + "logits": [ + 16.38452911376953, + 16.361656188964844, + 20.186168670654297, + 15.638021469116211 + ], + "pred": 2, + "answer_nll": 0.05330467224121094 + }, + { + "id": "test-lookup16-022", + "gold": 3, + "logits": [ + 15.813419342041016, + 15.580093383789062, + 16.336551666259766, + 19.467567443847656 + ], + "pred": 3, + "answer_nll": 0.0862274169921875 + }, + { + "id": "test-lookup16-023", + "gold": 2, + "logits": [ + 15.529457092285156, + 15.852638244628906, + 20.357547760009766, + 15.526824951171875 + ], + "pred": 2, + "answer_nll": 0.026678085327148438 + }, + { + "id": "test-lookup16-024", + "gold": 3, + "logits": [ + 15.914365768432617, + 15.774055480957031, + 15.853182792663574, + 19.586181640625 + ], + "pred": 3, + "answer_nll": 0.0690155029296875 + }, + { + "id": "test-lookup16-025", + "gold": 1, + "logits": [ + 17.838912963867188, + 20.985240936279297, + 15.659231185913086, + 15.130619049072266 + ], + "pred": 1, + "answer_nll": 0.04949378967285156 + }, + { + "id": "test-lookup16-026", + "gold": 2, + "logits": [ + 15.137718200683594, + 16.399246215820312, + 19.62148666381836, + 15.176868438720703 + ], + "pred": 2, + "answer_nll": 0.06099891662597656 + }, + { + "id": "test-lookup16-027", + "gold": 2, + "logits": [ + 15.731764793395996, + 15.832451820373535, + 19.631465911865234, + 15.122723579406738 + ], + "pred": 2, + "answer_nll": 0.05226325988769531 + }, + { + "id": "test-lookup16-028", + "gold": 2, + "logits": [ + 16.041873931884766, + 15.58057975769043, + 19.849225997924805, + 15.321564674377441 + ], + "pred": 2, + "answer_nll": 0.04594230651855469 + }, + { + "id": "test-lookup16-029", + "gold": 3, + "logits": [ + 15.244507789611816, + 15.027724266052246, + 15.831774711608887, + 19.21141815185547 + ], + "pred": 3, + "answer_nll": 0.06600570678710938 + }, + { + "id": "test-lookup16-030", + "gold": 0, + "logits": [ + 20.533977508544922, + 17.629533767700195, + 16.055776596069336, + 17.228370666503906 + ], + "pred": 0, + "answer_nll": 0.09786224365234375 + }, + { + "id": "test-lookup16-031", + "gold": 2, + "logits": [ + 15.729635238647461, + 15.51233959197998, + 20.183422088623047, + 15.370007514953613 + ], + "pred": 2, + "answer_nll": 0.028699874877929688 + } + ], + "linear": [ + { + "id": "test-lookup16-000", + "gold": 0, + "logits": [ + 20.734222412109375, + 17.27823257446289, + 15.281730651855469, + 15.934748649597168 + ], + "pred": 0, + "answer_nll": 0.043132781982421875 + }, + { + "id": "test-lookup16-001", + "gold": 3, + "logits": [ + 15.38165283203125, + 15.27231216430664, + 15.335987091064453, + 19.728811264038086 + ], + "pred": 3, + "answer_nll": 0.03624725341796875 + }, + { + "id": "test-lookup16-002", + "gold": 0, + "logits": [ + 19.671512603759766, + 17.568674087524414, + 15.78011417388916, + 17.036643981933594 + ], + "pred": 0, + "answer_nll": 0.19412994384765625 + }, + { + "id": "test-lookup16-003", + "gold": 1, + "logits": [ + 17.171268463134766, + 20.511455535888672, + 15.531414031982422, + 14.887357711791992 + ], + "pred": 1, + "answer_nll": 0.044891357421875 + }, + { + "id": "test-lookup16-004", + "gold": 1, + "logits": [ + 17.16248321533203, + 20.922515869140625, + 15.751140594482422, + 16.41477394104004 + ], + "pred": 1, + "answer_nll": 0.039203643798828125 + }, + { + "id": "test-lookup16-005", + "gold": 1, + "logits": [ + 16.97015380859375, + 20.078655242919922, + 16.533241271972656, + 15.431614875793457 + ], + "pred": 1, + "answer_nll": 0.07983970642089844 + }, + { + "id": "test-lookup16-006", + "gold": 0, + "logits": [ + 20.053985595703125, + 16.35597801208496, + 15.726594924926758, + 16.41789436340332 + ], + "pred": 0, + "answer_nll": 0.06234550476074219 + }, + { + "id": "test-lookup16-007", + "gold": 2, + "logits": [ + 15.308743476867676, + 15.324698448181152, + 19.736860275268555, + 15.257304191589355 + ], + "pred": 2, + "answer_nll": 0.03479194641113281 + }, + { + "id": "test-lookup16-008", + "gold": 3, + "logits": [ + 15.862666130065918, + 15.133445739746094, + 16.547945022583008, + 20.332399368286133 + ], + "pred": 3, + "answer_nll": 0.03892707824707031 + }, + { + "id": "test-lookup16-009", + "gold": 0, + "logits": [ + 21.145885467529297, + 18.00601577758789, + 17.418115615844727, + 17.628250122070312 + ], + "pred": 0, + "answer_nll": 0.09258270263671875 + }, + { + "id": "test-lookup16-010", + "gold": 1, + "logits": [ + 16.977426528930664, + 20.115814208984375, + 16.399511337280273, + 15.87421703338623 + ], + "pred": 1, + "answer_nll": 0.07886695861816406 + }, + { + "id": "test-lookup16-011", + "gold": 0, + "logits": [ + 20.42746925354004, + 18.514266967773438, + 17.465499877929688, + 16.284099578857422 + ], + "pred": 0, + "answer_nll": 0.1949024200439453 + }, + { + "id": "test-lookup16-012", + "gold": 3, + "logits": [ + 16.090831756591797, + 15.739912986755371, + 15.023618698120117, + 19.759035110473633 + ], + "pred": 3, + "answer_nll": 0.0509490966796875 + }, + { + "id": "test-lookup16-013", + "gold": 0, + "logits": [ + 20.454010009765625, + 17.82088279724121, + 16.49856948852539, + 18.459627151489258 + ], + "pred": 0, + "answer_nll": 0.20465469360351562 + }, + { + "id": "test-lookup16-014", + "gold": 0, + "logits": [ + 20.744304656982422, + 17.4469051361084, + 16.78378677368164, + 17.721250534057617 + ], + "pred": 0, + "answer_nll": 0.09955978393554688 + }, + { + "id": "test-lookup16-015", + "gold": 1, + "logits": [ + 17.539121627807617, + 21.236812591552734, + 15.622926712036133, + 15.462634086608887 + ], + "pred": 1, + "answer_nll": 0.031047821044921875 + }, + { + "id": "test-lookup16-016", + "gold": 3, + "logits": [ + 15.998991012573242, + 15.767592430114746, + 17.174209594726562, + 20.384096145629883 + ], + "pred": 3, + "answer_nll": 0.060821533203125 + }, + { + "id": "test-lookup16-017", + "gold": 3, + "logits": [ + 16.21446990966797, + 16.374713897705078, + 15.511122703552246, + 19.350505828857422 + ], + "pred": 3, + "answer_nll": 0.10972213745117188 + }, + { + "id": "test-lookup16-018", + "gold": 1, + "logits": [ + 17.280061721801758, + 20.596542358398438, + 14.671009063720703, + 14.20742416381836 + ], + "pred": 1, + "answer_nll": 0.03982734680175781 + }, + { + "id": "test-lookup16-019", + "gold": 2, + "logits": [ + 15.722611427307129, + 15.396200180053711, + 20.588932037353516, + 15.271456718444824 + ], + "pred": 2, + "answer_nll": 0.017999649047851562 + }, + { + "id": "test-lookup16-020", + "gold": 1, + "logits": [ + 17.80206871032715, + 20.00745391845703, + 15.990407943725586, + 15.54370403289795 + ], + "pred": 1, + "answer_nll": 0.13079452514648438 + }, + { + "id": "test-lookup16-021", + "gold": 2, + "logits": [ + 16.387752532958984, + 16.350372314453125, + 20.213966369628906, + 15.649048805236816 + ], + "pred": 2, + "answer_nll": 0.05182838439941406 + }, + { + "id": "test-lookup16-022", + "gold": 3, + "logits": [ + 15.796292304992676, + 15.564138412475586, + 16.34097671508789, + 19.49036407470703 + ], + "pred": 3, + "answer_nll": 0.08385086059570312 + }, + { + "id": "test-lookup16-023", + "gold": 2, + "logits": [ + 15.54217529296875, + 15.822200775146484, + 20.371597290039062, + 15.498486518859863 + ], + "pred": 2, + "answer_nll": 0.025876998901367188 + }, + { + "id": "test-lookup16-024", + "gold": 3, + "logits": [ + 15.924036026000977, + 15.779983520507812, + 15.868743896484375, + 19.63011360168457 + ], + "pred": 3, + "answer_nll": 0.06682014465332031 + }, + { + "id": "test-lookup16-025", + "gold": 1, + "logits": [ + 17.824155807495117, + 20.985830307006836, + 15.644603729248047, + 15.13800048828125 + ], + "pred": 1, + "answer_nll": 0.04881858825683594 + }, + { + "id": "test-lookup16-026", + "gold": 2, + "logits": [ + 15.134109497070312, + 16.354352951049805, + 19.626972198486328, + 15.14501667022705 + ], + "pred": 2, + "answer_nll": 0.05865287780761719 + }, + { + "id": "test-lookup16-027", + "gold": 2, + "logits": [ + 15.753355979919434, + 15.833460807800293, + 19.679513931274414, + 15.186768531799316 + ], + "pred": 2, + "answer_nll": 0.050952911376953125 + }, + { + "id": "test-lookup16-028", + "gold": 2, + "logits": [ + 16.064292907714844, + 15.575334548950195, + 19.879398345947266, + 15.318888664245605 + ], + "pred": 2, + "answer_nll": 0.044979095458984375 + }, + { + "id": "test-lookup16-029", + "gold": 3, + "logits": [ + 15.274552345275879, + 15.023715019226074, + 15.81680679321289, + 19.2641544342041 + ], + "pred": 3, + "answer_nll": 0.0627288818359375 + }, + { + "id": "test-lookup16-030", + "gold": 0, + "logits": [ + 20.53911590576172, + 17.615474700927734, + 16.09842872619629, + 17.269329071044922 + ], + "pred": 0, + "answer_nll": 0.09852409362792969 + }, + { + "id": "test-lookup16-031", + "gold": 2, + "logits": [ + 15.725439071655273, + 15.48648452758789, + 20.21923065185547, + 15.35004997253418 + ], + "pred": 2, + "answer_nll": 0.027284622192382812 + } + ], + "lisa": [ + { + "id": "test-lookup16-000", + "gold": 0, + "logits": [ + 20.490337371826172, + 17.654937744140625, + 16.538249969482422, + 16.651599884033203 + ], + "pred": 0, + "answer_nll": 0.09479141235351562 + }, + { + "id": "test-lookup16-001", + "gold": 3, + "logits": [ + 16.522504806518555, + 16.650516510009766, + 17.174114227294922, + 19.548336029052734 + ], + "pred": 3, + "answer_nll": 0.17960739135742188 + }, + { + "id": "test-lookup16-002", + "gold": 0, + "logits": [ + 19.685928344726562, + 17.94719696044922, + 17.28326416015625, + 17.743146896362305 + ], + "pred": 0, + "answer_nll": 0.34325218200683594 + }, + { + "id": "test-lookup16-003", + "gold": 1, + "logits": [ + 17.90443992614746, + 20.28855323791504, + 16.62894058227539, + 16.31715202331543 + ], + "pred": 1, + "answer_nll": 0.12818145751953125 + }, + { + "id": "test-lookup16-004", + "gold": 1, + "logits": [ + 18.154644012451172, + 20.796424865722656, + 17.42681121826172, + 17.98230743408203 + ], + "pred": 1, + "answer_nll": 0.15323257446289062 + }, + { + "id": "test-lookup16-005", + "gold": 1, + "logits": [ + 17.829914093017578, + 19.918691635131836, + 17.973928451538086, + 16.938316345214844 + ], + "pred": 1, + "answer_nll": 0.2758369445800781 + }, + { + "id": "test-lookup16-006", + "gold": 0, + "logits": [ + 20.206844329833984, + 17.443689346313477, + 17.444454193115234, + 17.800764083862305 + ], + "pred": 0, + "answer_nll": 0.19589614868164062 + }, + { + "id": "test-lookup16-007", + "gold": 2, + "logits": [ + 16.541717529296875, + 16.656465530395508, + 20.024507522583008, + 16.894441604614258 + ], + "pred": 2, + "answer_nll": 0.103363037109375 + }, + { + "id": "test-lookup16-008", + "gold": 3, + "logits": [ + 17.047019958496094, + 16.653728485107422, + 17.4296875, + 20.174789428710938 + ], + "pred": 3, + "answer_nll": 0.12894248962402344 + }, + { + "id": "test-lookup16-009", + "gold": 0, + "logits": [ + 20.979900360107422, + 18.398611068725586, + 17.975994110107422, + 17.96030044555664 + ], + "pred": 0, + "answer_nll": 0.1604938507080078 + }, + { + "id": "test-lookup16-010", + "gold": 1, + "logits": [ + 17.825695037841797, + 19.60110855102539, + 17.446510314941406, + 16.778614044189453 + ], + "pred": 1, + "answer_nll": 0.2962608337402344 + }, + { + "id": "test-lookup16-011", + "gold": 0, + "logits": [ + 20.514293670654297, + 18.81818389892578, + 18.097806930541992, + 17.28689956665039 + ], + "pred": 0, + "answer_nll": 0.2717742919921875 + }, + { + "id": "test-lookup16-012", + "gold": 3, + "logits": [ + 16.780887603759766, + 16.640655517578125, + 16.773744583129883, + 19.776287078857422 + ], + "pred": 3, + "answer_nll": 0.1337871551513672 + }, + { + "id": "test-lookup16-013", + "gold": 0, + "logits": [ + 20.464096069335938, + 18.334558486938477, + 17.793392181396484, + 18.577505111694336 + ], + "pred": 0, + "answer_nll": 0.2924327850341797 + }, + { + "id": "test-lookup16-014", + "gold": 0, + "logits": [ + 20.577285766601562, + 17.71739387512207, + 17.893171310424805, + 18.02859115600586 + ], + "pred": 0, + "answer_nll": 0.18543434143066406 + }, + { + "id": "test-lookup16-015", + "gold": 1, + "logits": [ + 18.47882843017578, + 21.03084945678711, + 17.141637802124023, + 16.882877349853516 + ], + "pred": 1, + "answer_nll": 0.10811996459960938 + }, + { + "id": "test-lookup16-016", + "gold": 3, + "logits": [ + 16.89795684814453, + 16.774860382080078, + 18.19284439086914, + 19.79840850830078 + ], + "pred": 3, + "answer_nll": 0.2657451629638672 + }, + { + "id": "test-lookup16-017", + "gold": 3, + "logits": [ + 17.200220108032227, + 17.03335952758789, + 17.39498519897461, + 19.772201538085938 + ], + "pred": 3, + "answer_nll": 0.2101287841796875 + }, + { + "id": "test-lookup16-018", + "gold": 1, + "logits": [ + 18.3189697265625, + 20.713918685913086, + 17.27461051940918, + 16.837020874023438 + ], + "pred": 1, + "answer_nll": 0.13451194763183594 + }, + { + "id": "test-lookup16-019", + "gold": 2, + "logits": [ + 17.165782928466797, + 17.35761070251465, + 20.6196346282959, + 17.078256607055664 + ], + "pred": 2, + "answer_nll": 0.09431648254394531 + }, + { + "id": "test-lookup16-020", + "gold": 1, + "logits": [ + 18.227575302124023, + 19.70290184020996, + 17.27104949951172, + 16.77157974243164 + ], + "pred": 1, + "answer_nll": 0.3147411346435547 + }, + { + "id": "test-lookup16-021", + "gold": 2, + "logits": [ + 17.27737808227539, + 17.190292358398438, + 20.204147338867188, + 17.25939178466797 + ], + "pred": 2, + "answer_nll": 0.14434814453125 + }, + { + "id": "test-lookup16-022", + "gold": 3, + "logits": [ + 17.37074089050293, + 16.571868896484375, + 18.036226272583008, + 19.97149658203125 + ], + "pred": 3, + "answer_nll": 0.2247333526611328 + }, + { + "id": "test-lookup16-023", + "gold": 2, + "logits": [ + 16.849794387817383, + 16.987442016601562, + 20.686952590942383, + 16.925445556640625 + ], + "pred": 2, + "answer_nll": 0.06722831726074219 + }, + { + "id": "test-lookup16-024", + "gold": 3, + "logits": [ + 17.134410858154297, + 16.855791091918945, + 17.403955459594727, + 19.708759307861328 + ], + "pred": 3, + "answer_nll": 0.20998191833496094 + }, + { + "id": "test-lookup16-025", + "gold": 1, + "logits": [ + 18.855209350585938, + 20.464717864990234, + 16.991188049316406, + 16.484619140625 + ], + "pred": 1, + "answer_nll": 0.2228851318359375 + }, + { + "id": "test-lookup16-026", + "gold": 2, + "logits": [ + 17.251935958862305, + 17.34075355529785, + 19.861461639404297, + 16.851882934570312 + ], + "pred": 2, + "answer_nll": 0.18505477905273438 + }, + { + "id": "test-lookup16-027", + "gold": 2, + "logits": [ + 16.87265968322754, + 16.96160125732422, + 20.11630630493164, + 16.644906997680664 + ], + "pred": 2, + "answer_nll": 0.10683059692382812 + }, + { + "id": "test-lookup16-028", + "gold": 2, + "logits": [ + 17.305179595947266, + 17.150022506713867, + 20.152006149291992, + 17.112558364868164 + ], + "pred": 2, + "answer_nll": 0.14459991455078125 + }, + { + "id": "test-lookup16-029", + "gold": 3, + "logits": [ + 16.536590576171875, + 16.207822799682617, + 17.313720703125, + 19.418651580810547 + ], + "pred": 3, + "answer_nll": 0.1973724365234375 + }, + { + "id": "test-lookup16-030", + "gold": 0, + "logits": [ + 20.428970336914062, + 18.188112258911133, + 17.756412506103516, + 17.95325469970703 + ], + "pred": 0, + "answer_nll": 0.23075103759765625 + }, + { + "id": "test-lookup16-031", + "gold": 2, + "logits": [ + 17.199758529663086, + 16.905183792114258, + 20.355880737304688, + 16.986587524414062 + ], + "pred": 2, + "answer_nll": 0.10321426391601562 + } + ], + "lisa_answer_weighted": [ + { + "id": "test-lookup16-000", + "gold": 0, + "logits": [ + 22.57941246032715, + 19.45975112915039, + 17.538860321044922, + 17.91460609436035 + ], + "pred": 0, + "answer_nll": 0.05832862854003906 + }, + { + "id": "test-lookup16-001", + "gold": 3, + "logits": [ + 18.762800216674805, + 18.690874099731445, + 18.37322425842285, + 21.59368324279785 + ], + "pred": 3, + "answer_nll": 0.14303207397460938 + }, + { + "id": "test-lookup16-002", + "gold": 0, + "logits": [ + 21.95724868774414, + 19.788686752319336, + 17.899444580078125, + 18.999929428100586 + ], + "pred": 0, + "answer_nll": 0.168548583984375 + }, + { + "id": "test-lookup16-003", + "gold": 1, + "logits": [ + 19.723478317260742, + 22.322696685791016, + 17.424434661865234, + 16.90584945678711 + ], + "pred": 1, + "answer_nll": 0.08271598815917969 + }, + { + "id": "test-lookup16-004", + "gold": 1, + "logits": [ + 19.81602668762207, + 22.845874786376953, + 18.12343406677246, + 18.654464721679688 + ], + "pred": 1, + "answer_nll": 0.06984519958496094 + }, + { + "id": "test-lookup16-005", + "gold": 1, + "logits": [ + 19.68820571899414, + 22.387584686279297, + 19.071063995361328, + 17.41537857055664 + ], + "pred": 1, + "answer_nll": 0.10476875305175781 + }, + { + "id": "test-lookup16-006", + "gold": 0, + "logits": [ + 22.55522918701172, + 19.28392791748047, + 17.920703887939453, + 18.927051544189453 + ], + "pred": 0, + "answer_nll": 0.07160568237304688 + }, + { + "id": "test-lookup16-007", + "gold": 2, + "logits": [ + 18.43319320678711, + 18.58353042602539, + 22.273773193359375, + 17.731338500976562 + ], + "pred": 2, + "answer_nll": 0.05552482604980469 + }, + { + "id": "test-lookup16-008", + "gold": 3, + "logits": [ + 19.334627151489258, + 18.89589500427246, + 18.96323013305664, + 22.12887191772461 + ], + "pred": 3, + "answer_nll": 0.1334705352783203 + }, + { + "id": "test-lookup16-009", + "gold": 0, + "logits": [ + 22.693693161010742, + 19.684255599975586, + 18.74317741394043, + 18.62442970275879 + ], + "pred": 0, + "answer_nll": 0.08218193054199219 + }, + { + "id": "test-lookup16-010", + "gold": 1, + "logits": [ + 19.611141204833984, + 22.27094841003418, + 18.29421615600586, + 17.541038513183594 + ], + "pred": 1, + "answer_nll": 0.09306716918945312 + }, + { + "id": "test-lookup16-011", + "gold": 0, + "logits": [ + 22.52837562561035, + 20.651630401611328, + 18.503936767578125, + 17.947612762451172 + ], + "pred": 0, + "answer_nll": 0.16653823852539062 + }, + { + "id": "test-lookup16-012", + "gold": 3, + "logits": [ + 19.092853546142578, + 19.007957458496094, + 18.225162506103516, + 21.918743133544922 + ], + "pred": 3, + "answer_nll": 0.1297740936279297 + }, + { + "id": "test-lookup16-013", + "gold": 0, + "logits": [ + 22.434616088867188, + 19.77047348022461, + 18.417800903320312, + 19.482641220092773 + ], + "pred": 0, + "answer_nll": 0.13094520568847656 + }, + { + "id": "test-lookup16-014", + "gold": 0, + "logits": [ + 22.530967712402344, + 19.402698516845703, + 18.867340087890625, + 19.061908721923828 + ], + "pred": 0, + "answer_nll": 0.09583663940429688 + }, + { + "id": "test-lookup16-015", + "gold": 1, + "logits": [ + 20.003738403320312, + 22.868587493896484, + 17.58453941345215, + 17.39547348022461 + ], + "pred": 1, + "answer_nll": 0.06415939331054688 + }, + { + "id": "test-lookup16-016", + "gold": 3, + "logits": [ + 19.308162689208984, + 19.08233070373535, + 19.386898040771484, + 21.79644012451172 + ], + "pred": 3, + "answer_nll": 0.2144451141357422 + }, + { + "id": "test-lookup16-017", + "gold": 3, + "logits": [ + 20.279794692993164, + 19.779443740844727, + 18.525131225585938, + 21.782852172851562 + ], + "pred": 3, + "answer_nll": 0.3334674835205078 + }, + { + "id": "test-lookup16-018", + "gold": 1, + "logits": [ + 20.275941848754883, + 22.887203216552734, + 18.032726287841797, + 17.627124786376953 + ], + "pred": 1, + "answer_nll": 0.08289718627929688 + }, + { + "id": "test-lookup16-019", + "gold": 2, + "logits": [ + 19.167579650878906, + 19.06737518310547, + 22.443363189697266, + 17.818435668945312 + ], + "pred": 2, + "answer_nll": 0.07860374450683594 + }, + { + "id": "test-lookup16-020", + "gold": 1, + "logits": [ + 20.483108520507812, + 22.062461853027344, + 18.30929946899414, + 17.787281036376953 + ], + "pred": 1, + "answer_nll": 0.21789932250976562 + }, + { + "id": "test-lookup16-021", + "gold": 2, + "logits": [ + 19.33902359008789, + 18.947465896606445, + 22.09600257873535, + 17.865291595458984 + ], + "pred": 2, + "answer_nll": 0.11416816711425781 + }, + { + "id": "test-lookup16-022", + "gold": 3, + "logits": [ + 19.480201721191406, + 18.828689575195312, + 19.617446899414062, + 21.960355758666992 + ], + "pred": 3, + "answer_nll": 0.20165252685546875 + }, + { + "id": "test-lookup16-023", + "gold": 2, + "logits": [ + 19.01500129699707, + 18.909576416015625, + 22.426218032836914, + 17.542627334594727 + ], + "pred": 2, + "answer_nll": 0.06791114807128906 + }, + { + "id": "test-lookup16-024", + "gold": 3, + "logits": [ + 19.611690521240234, + 19.304908752441406, + 18.592029571533203, + 21.793827056884766 + ], + "pred": 3, + "answer_nll": 0.21227645874023438 + }, + { + "id": "test-lookup16-025", + "gold": 1, + "logits": [ + 20.47852897644043, + 22.489200592041016, + 17.568195343017578, + 16.940229415893555 + ], + "pred": 1, + "answer_nll": 0.13547706604003906 + }, + { + "id": "test-lookup16-026", + "gold": 2, + "logits": [ + 19.137346267700195, + 19.278215408325195, + 21.883272171020508, + 17.456897735595703 + ], + "pred": 2, + "answer_nll": 0.139801025390625 + }, + { + "id": "test-lookup16-027", + "gold": 2, + "logits": [ + 19.165250778198242, + 18.819297790527344, + 22.282611846923828, + 17.436832427978516 + ], + "pred": 2, + "answer_nll": 0.08016014099121094 + }, + { + "id": "test-lookup16-028", + "gold": 2, + "logits": [ + 19.52033805847168, + 18.817392349243164, + 22.188508987426758, + 17.81803321838379 + ], + "pred": 2, + "answer_nll": 0.11008644104003906 + }, + { + "id": "test-lookup16-029", + "gold": 3, + "logits": [ + 18.95032501220703, + 18.286874771118164, + 19.390106201171875, + 21.473861694335938 + ], + "pred": 3, + "answer_nll": 0.21988487243652344 + }, + { + "id": "test-lookup16-030", + "gold": 0, + "logits": [ + 22.682191848754883, + 19.893630981445312, + 18.4726505279541, + 18.731189727783203 + ], + "pred": 0, + "answer_nll": 0.09130096435546875 + }, + { + "id": "test-lookup16-031", + "gold": 2, + "logits": [ + 19.434579849243164, + 18.631267547607422, + 22.36871337890625, + 17.62336540222168 + ], + "pred": 2, + "answer_nll": 0.08221054077148438 + } + ] +} diff --git a/results/lisa-effect-reproduction/trace.json b/results/lisa-effect-reproduction/trace.json new file mode 100644 index 0000000..f3d84d1 --- /dev/null +++ b/results/lisa-effect-reproduction/trace.json @@ -0,0 +1,38 @@ +{ + "linear": [ + { + "epoch": 1, + "fit_loss": 1.528187096118927, + "validation_answer_nll": 0.08188676834106445 + }, + { + "epoch": 2, + "fit_loss": 1.4630066951115925, + "validation_answer_nll": 0.08137226104736328 + } + ], + "lisa": [ + { + "epoch": 1, + "fit_loss": 2.8282371163368225, + "validation_answer_nll": 0.21536986033121744 + }, + { + "epoch": 2, + "fit_loss": 2.06735689441363, + "validation_answer_nll": 0.18566656112670898 + } + ], + "lisa_answer_weighted": [ + { + "epoch": 1, + "fit_loss": 2.752801299095154, + "validation_answer_nll": 0.23118178049723306 + }, + { + "epoch": 2, + "fit_loss": 1.9780630469322205, + "validation_answer_nll": 0.1396172841389974 + } + ] +} diff --git a/results/lisa-effect-reproduction/train-protocol.json b/results/lisa-effect-reproduction/train-protocol.json new file mode 100644 index 0000000..6058685 --- /dev/null +++ b/results/lisa-effect-reproduction/train-protocol.json @@ -0,0 +1,21 @@ +{ + "epochs": 2, + "selection": { + "task": "lookup16", + "sites": [ + 19, + 23 + ], + "fixed_problems_sha256": "34252a9e02e79c0e0d786ee8b90bb0c5a4fe22e97852929fedf73db7b6dc7826", + "source_sha256": { + "manifest.json": "28efbaf94a5034333339a35f08ead151459a7d20c6c2d2f07a451e7f3bf154de", + "model_config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4", + "tokenizer.json": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42" + } + }, + "optimizer": "AdamW", + "lr": 0.0003, + "weight_decay": 0.1, + "answer_weight": 16.0, + "seed": 415005 +} -- 2.52.0 From 78f3869060a10636b0621a7eb39e9783cfb9b16d Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Tue, 24 Nov 2026 01:39:44 +0800 Subject: [PATCH 4/4] Verify LiSA full-vocabulary results and report scope --- docs/LISA_EFFECT_RESULTS.md | 22 +- .../answer-token-diagnostic.json | 104 ++ .../full-vocab-answers.json | 1633 +++++++++++++++++ .../paired-audit.json | 123 ++ results/lisa-effect-reproduction/runtime.json | 20 + .../verified-audit.json | 297 +++ 6 files changed, 2197 insertions(+), 2 deletions(-) create mode 100644 results/lisa-effect-reproduction/answer-token-diagnostic.json create mode 100644 results/lisa-effect-reproduction/full-vocab-answers.json create mode 100644 results/lisa-effect-reproduction/paired-audit.json create mode 100644 results/lisa-effect-reproduction/verified-audit.json diff --git a/docs/LISA_EFFECT_RESULTS.md b/docs/LISA_EFFECT_RESULTS.md index c2e2aad..4f3b97f 100644 --- a/docs/LISA_EFFECT_RESULTS.md +++ b/docs/LISA_EFFECT_RESULTS.md @@ -1,6 +1,6 @@ # Qwen3.5-2B 双层 LiSA 复现实验 -在固定的 32 道查找题上,原模型、直接共享、线性修正和两版 LiSA 都答对 32 道。原版 LiSA 降低了接收层 K/V 缓存,并在投影权重常驻内存时缩短了两个接收层的单步解码时间。按本次 CPU 权重流式读取方式测量,第 19 层单步解码更快,第 23 层略慢,双层共享的预填充更慢。全词表答案复核正在运行。 +在冻结的 32 道查找题上,原模型、直接共享、线性修正和两版 LiSA 的四选一准确率均为 32/32。全词表首 token 命中率从双层直接共享的 27/32 升到两版 LiSA 的 32/32。五道变化题都涉及首 token 从 `` 变成正确选项。两个接收层各自的 K/V 缓存减少 42.2%。耗时随权重是否驻留及测量阶段而异。 ## 四选一任务表现 @@ -14,7 +14,23 @@ | 双层 LiSA | 32/32 | 0.1846 | | 双层 LiSA,答案损失加权 | 32/32 | 0.1260 | -直接共享在留出集上丢失 0 道原模型答对的题,因此无法估计 LiSA 对这类错题的恢复率。答案加权把 LiSA 的四选一 NLL 降低了 0.0586,仍高于直接共享。三种训练方法各用 12 道拟合题跑两轮,并由另外 12 道验证题选择检查点。所选检查点都是第 2 轮。逐题 logits、训练轨迹及检查点哈希随结果归档。 +直接共享在留出集上丢失 0 道原模型答对的题,因此无法估计 LiSA 对这类错题的恢复率。答案加权把 LiSA 的四选一 NLL 降低了 0.0586,仍高于直接共享。相比直接共享,原版 LiSA 的 NLL 增加 0.1118,按题配对 bootstrap 95% 区间为 [0.0968, 0.1282]。答案加权 LiSA 的差为 0.0532,区间为 [0.0327, 0.0749]。三种训练方法各用 12 道拟合题跑两轮,并由另外 12 道验证题选择检查点。所选检查点都是第 2 轮。 + +## 全词表首 token + +| 方法 | 正确选项为首 token | 全词表答案 NLL ↓ | +| --- | ---: | ---: | +| 原模型 | 27/32 | 0.5633 | +| 单层直接共享,第 23 层 | 32/32 | 0.3124 | +| 单层 LiSA,第 23 层,使用双层训练的适配器 | 32/32 | 0.2554 | +| 双层直接共享 | 27/32 | 0.5579 | +| 双层线性修正 | 27/32 | 0.5574 | +| 双层 LiSA | 32/32 | 0.4706 | +| 双层 LiSA,答案损失加权 | 32/32 | 0.1545 | + +两版 LiSA 对双层直接共享的首 token 净改善均为 5/32,另有 0 道从正确变成错误,McNemar 精确双侧 p = 0.0625。双层直接共享比单层直接共享少答对的五道,恰好也是原模型和线性修正先输出 `` 的五道。它们的正确选项都是 `4`,四选一口径在全部方法上均答对。输出符合格式是这里观察到的改善,后续生成内容没有记录。 + +原版 LiSA 相对双层直接共享的全词表 NLL 差为 −0.0872,按题配对 bootstrap 95% 区间为 [−0.1498, −0.0305]。答案加权版的差为 −0.4033,区间为 [−0.4796, −0.3344]。原版和加权版的首 token 命中数一致,加权版的平均答案 NLL 更低。由于五道变化集中于同一选项和同一个替代 token,推广到其它任务或输出格式还需要独立证据。 ## CPU 计时和缓存 @@ -29,3 +45,5 @@ 每个接收层的 FP32 K/V 实际分配从 643,072 降到 371,776 字节,下降 42.2%。计入该层所用的 5,024 字节上游分数行后,单层合计下降 41.4%。V 缓存为 321,536 字节。解码计时的单位是单个接收层的一步,计时范围从接收现成分数行开始,至该层注意力输出结束。预填充用 3 次计时的中位数,单层解码每个配置用 9 步计时的中位数。 论文表 2 的 96.44% 衡量 LLaMA2-13B 在共享 22 层时多个基准上的平均性能保留率。这里每轮只有 1,874 个训练目标 token,测到的是单一查找任务的表现和 CPU 组件耗时。 [论文表 2、表 3 和附录 C.1](https://aclanthology.org/2026.tacl-1.30.pdf) + +训练轨迹、两种答案口径的逐题记录、配对统计、缓存和时延原始结果均在 [实验结果目录](../results/lisa-effect-reproduction/)。[复跑协议](LISA_EFFECT_PROTOCOL.md) diff --git a/results/lisa-effect-reproduction/answer-token-diagnostic.json b/results/lisa-effect-reproduction/answer-token-diagnostic.json new file mode 100644 index 0000000..b03d6e7 --- /dev/null +++ b/results/lisa-effect-reproduction/answer-token-diagnostic.json @@ -0,0 +1,104 @@ +{ + "tokenizer_sha256": "5f9e4d4901a92b997e463c1f46055088b6cca5ca61a6522d1b9f64c4bb81cb42", + "source_sha256": "b3a113d5ea1e4d11e9fdd2ff5e066a50ad3e75b3c20b109e2add05179c7e3eb4", + "decoded_tokens": { + "16": "1", + "17": "2", + "18": "3", + "19": "4", + "248068": "" + }, + "target_counts": { + "1": 8, + "4": 8, + "2": 8, + "3": 8 + }, + "wrong_first_tokens": { + "native": [ + { + "item": "test-lookup16-012", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-017", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-022", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-024", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-029", + "expected": "4", + "produced": "" + } + ], + "direct_23": [], + "lisa_23_ablation": [], + "direct_chain": [ + { + "item": "test-lookup16-012", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-017", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-022", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-024", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-029", + "expected": "4", + "produced": "" + } + ], + "lisa_chain": [], + "linear": [ + { + "item": "test-lookup16-012", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-017", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-022", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-024", + "expected": "4", + "produced": "" + }, + { + "item": "test-lookup16-029", + "expected": "4", + "produced": "" + } + ], + "lisa_answer_weighted": [] + } +} diff --git a/results/lisa-effect-reproduction/full-vocab-answers.json b/results/lisa-effect-reproduction/full-vocab-answers.json new file mode 100644 index 0000000..87b0b59 --- /dev/null +++ b/results/lisa-effect-reproduction/full-vocab-answers.json @@ -0,0 +1,1633 @@ +{ + "single_lisa_is_ablation_of_joint_checkpoint": true, + "candidate_sites": [ + 19, + 23 + ], + "arms": { + "native": { + "n": 32, + "full_vocab_correct": 27, + "four_choice_correct": 32, + "full_vocab_nll": 0.5633379220962524, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.2913703918457031 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6106319427490234 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.7836437225341797 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.3534393310546875 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.323333740234375 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.4660358428955078 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3048095703125 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6507740020751953 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5432033538818359 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3056526184082031 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.5379638671875 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3849906921386719 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.7872695922851562 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.39174652099609375 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.38993072509765625 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.28702545166015625 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6224460601806641 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.9977951049804688 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.34217071533203125 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6122379302978516 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.7432975769042969 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4747428894042969 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.8575363159179688 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6229686737060547 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.8869895935058594 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.4425773620605469 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.7351837158203125 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6455326080322266 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.662139892578125 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.8653736114501953 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.40364646911621094 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.7003536224365234 + } + ] + }, + "direct_23": { + "n": 32, + "full_vocab_correct": 32, + "four_choice_correct": 32, + "full_vocab_nll": 0.31241124868392944, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.109283447265625 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.3464775085449219 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.41895294189453125 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.183502197265625 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.1761493682861328 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.24253463745117188 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.14193153381347656 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.43094635009765625 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.2855033874511719 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.16510963439941406 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.33880043029785156 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.21163558959960938 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.4163379669189453 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.20059967041015625 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.19157981872558594 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.13744735717773438 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.34366416931152344 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5921268463134766 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.19126319885253906 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.2948417663574219 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.42482566833496094 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.23002052307128906 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5005760192871094 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.29778099060058594 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.48000335693359375 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2525959014892578 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4467964172363281 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3799247741699219 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3622016906738281 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6218204498291016 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.2176513671875 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3642749786376953 + } + ] + }, + "lisa_23_ablation": { + "n": 32, + "full_vocab_correct": 32, + "four_choice_correct": 32, + "full_vocab_nll": 0.2554302215576172, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.11136245727539062 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.2672157287597656 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3835792541503906 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.19123268127441406 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.16318130493164062 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2173023223876953 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.13559341430664062 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.26752662658691406 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.21580123901367188 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.16622161865234375 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2782764434814453 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.20265960693359375 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.3230476379394531 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.1955108642578125 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.16601181030273438 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.12464714050292969 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.30491065979003906 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.4342002868652344 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.1830577850341797 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.22038650512695312 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.3855609893798828 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.21735572814941406 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.3915748596191406 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.21754074096679688 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.401214599609375 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.23748779296875 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3586254119873047 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.2827606201171875 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.28392791748046875 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.4265937805175781 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.18364524841308594 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.23575401306152344 + } + ] + }, + "direct_chain": { + "n": 32, + "full_vocab_correct": 27, + "four_choice_correct": 32, + "full_vocab_nll": 0.5578678846359253, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3183479309082031 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5239696502685547 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.8209362030029297 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.24486732482910156 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2363719940185547 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.48735618591308594 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5308666229248047 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6660423278808594 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.49617576599121094 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3050212860107422 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.4808464050292969 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5742206573486328 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.9365863800048828 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5229129791259766 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3802814483642578 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.1660175323486328 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5433444976806641 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.1320037841796875 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.3711109161376953 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3973884582519531 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.7193107604980469 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.43389320373535156 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.1536273956298828 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4581336975097656 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.8554534912109375 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2142333984375 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6487503051757812 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6499652862548828 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.570556640625 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.1456546783447266 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.4597358703613281 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4077892303466797 + } + ] + }, + "lisa_chain": { + "n": 32, + "full_vocab_correct": 32, + "four_choice_correct": 32, + "full_vocab_nll": 0.4706266522407532, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.2843437194824219 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5121250152587891 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.7151947021484375 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.3157539367675781 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.30004310607910156 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.5687484741210938 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.4294281005859375 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4567756652832031 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.439605712890625 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3144340515136719 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.6874465942382812 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.4803180694580078 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6189651489257812 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.4888916015625 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.38561439514160156 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.22623825073242188 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6850471496582031 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6490306854248047 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.3177757263183594 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.345703125 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.6682815551757812 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3826942443847656 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6482791900634766 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.31624794006347656 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6113262176513672 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.36820220947265625 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.5222606658935547 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.43080711364746094 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.4147682189941406 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.6809349060058594 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.4712238311767578 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3235435485839844 + } + ] + }, + "linear": { + "n": 32, + "full_vocab_correct": 27, + "four_choice_correct": 32, + "full_vocab_nll": 0.5574188828468323, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.31511497497558594 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.5147743225097656 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.8208713531494141 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2481365203857422 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.2372894287109375 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.48735618591308594 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5423679351806641 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6620750427246094 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.4863700866699219 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.30583953857421875 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.48926544189453125 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5762729644775391 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.9469871520996094 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.5251712799072266 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.3847312927246094 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.16637802124023438 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.53973388671875 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.1358528137207031 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.37953948974609375 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3931999206542969 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.71502685546875 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.42623138427734375 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.157938003540039 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.452239990234375 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 0.8458576202392578 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.21294593811035156 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6467056274414062 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.6391544342041016 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.5682315826416016 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 248068, + "choice_id": 19, + "nll": 1.1514034271240234 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.46894264221191406 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.3953990936279297 + } + ] + }, + "lisa_answer_weighted": { + "n": 32, + "full_vocab_correct": 32, + "four_choice_correct": 32, + "full_vocab_nll": 0.15454155206680298, + "rows": [ + { + "id": "test-lookup16-000", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.0784454345703125 + }, + { + "id": "test-lookup16-001", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.17988967895507812 + }, + { + "id": "test-lookup16-002", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.20417404174804688 + }, + { + "id": "test-lookup16-003", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.10232734680175781 + }, + { + "id": "test-lookup16-004", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.08465003967285156 + }, + { + "id": "test-lookup16-005", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.1261272430419922 + }, + { + "id": "test-lookup16-006", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.09234428405761719 + }, + { + "id": "test-lookup16-007", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.08498954772949219 + }, + { + "id": "test-lookup16-008", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.1656780242919922 + }, + { + "id": "test-lookup16-009", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.10147857666015625 + }, + { + "id": "test-lookup16-010", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.11818885803222656 + }, + { + "id": "test-lookup16-011", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.19247817993164062 + }, + { + "id": "test-lookup16-012", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.17107200622558594 + }, + { + "id": "test-lookup16-013", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.1558094024658203 + }, + { + "id": "test-lookup16-014", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.11965370178222656 + }, + { + "id": "test-lookup16-015", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.07797050476074219 + }, + { + "id": "test-lookup16-016", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.2587165832519531 + }, + { + "id": "test-lookup16-017", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.369384765625 + }, + { + "id": "test-lookup16-018", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.09921836853027344 + }, + { + "id": "test-lookup16-019", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.107940673828125 + }, + { + "id": "test-lookup16-020", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.24660301208496094 + }, + { + "id": "test-lookup16-021", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.1440143585205078 + }, + { + "id": "test-lookup16-022", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.24571609497070312 + }, + { + "id": "test-lookup16-023", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.09651947021484375 + }, + { + "id": "test-lookup16-024", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.2529735565185547 + }, + { + "id": "test-lookup16-025", + "gold_id": 17, + "greedy_id": 17, + "choice_id": 17, + "nll": 0.1515522003173828 + }, + { + "id": "test-lookup16-026", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.17531776428222656 + }, + { + "id": "test-lookup16-027", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.10755538940429688 + }, + { + "id": "test-lookup16-028", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.1405792236328125 + }, + { + "id": "test-lookup16-029", + "gold_id": 19, + "greedy_id": 19, + "choice_id": 19, + "nll": 0.27286720275878906 + }, + { + "id": "test-lookup16-030", + "gold_id": 16, + "greedy_id": 16, + "choice_id": 16, + "nll": 0.11458396911621094 + }, + { + "id": "test-lookup16-031", + "gold_id": 18, + "greedy_id": 18, + "choice_id": 18, + "nll": 0.10651016235351562 + } + ] + } + } +} diff --git a/results/lisa-effect-reproduction/paired-audit.json b/results/lisa-effect-reproduction/paired-audit.json new file mode 100644 index 0000000..69ce134 --- /dev/null +++ b/results/lisa-effect-reproduction/paired-audit.json @@ -0,0 +1,123 @@ +{ + "selected_task": "lookup16", + "sites": [ + 19, + 23 + ], + "n": 32, + "arms": { + "native": { + "correct": 32, + "answer_nll_4": 0.1341308259358034, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "direct": { + "correct": 32, + "answer_nll_4": 0.07281379044277814, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "linear": { + "correct": 32, + "answer_nll_4": 0.07204867493801925, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "lisa": { + "correct": 32, + "answer_nll_4": 0.1846203565157959, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "lisa_answer_weighted": { + "correct": 32, + "answer_nll_4": 0.12601824456448818, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + } + }, + "prefill": { + "scope": "cached-prefix last layers, prefill", + "median_s": { + "native": 12.369724708609283, + "direct": 11.017615622840822, + "lisa": 16.311319678090513 + }, + "lisa_median_ratio_to_native": 1.3186485602818545 + }, + "decode": { + "scope": "isolated full-attention recipient, FP32, frozen true activations; excludes donor generation and full-model decode", + "sites": { + "19": { + "median_s_per_token": { + "native": 0.1361464262008667, + "lisa": 0.0963163236156106 + }, + "measured_kv_bytes": { + "native": 643072, + "lisa": 371776 + }, + "lisa_upstream_score_row_bytes": 5024, + "recipient_bytes_delta": -266272 + }, + "23": { + "median_s_per_token": { + "native": 0.13638535235077143, + "lisa": 0.1387955490499735 + }, + "measured_kv_bytes": { + "native": 643072, + "lisa": 371776 + }, + "lisa_upstream_score_row_bytes": 5024, + "recipient_bytes_delta": -266272 + } + } + } +} diff --git a/results/lisa-effect-reproduction/runtime.json b/results/lisa-effect-reproduction/runtime.json index b07d71d..2a88b45 100644 --- a/results/lisa-effect-reproduction/runtime.json +++ b/results/lisa-effect-reproduction/runtime.json @@ -36,6 +36,26 @@ "lisa.pt": {"epoch": 2, "sha256": "358272c5eb90cea9e3ed006b2c75a4bcd7f5db4f857982e078dd7f71c6c46c5b"}, "lisa_answer_weighted.pt": {"epoch": 2, "sha256": "2b384d5618c190b29bdbb1bc0151c1eb64e1699e209a50ed8171a2d"} }, + "final_remote_verification": { + "pipeline_exit_code": 0, + "unittest_modules": [ + "tests.test_lisa_train", + "tests.test_lisa_tail", + "tests.test_lisa_effect_screen", + "tests.test_lisa_effect_resume", + "tests.test_lisa_effect_audit" + ], + "passed": 13, + "sha256": { + "test-items.json": "e978b482479deec2d78f8b19d75a5f708bd383111a4c360aad41384e572d48af", + "full-vocab-answers.json": "b3a113d5ea1e4d11e9fdd2ff5e066a50ad3e75b3c20b109e2add05179c7e3eb4", + "paired-audit.json": "f66e60b229cdeaaf6c295382b3bf617332e28f95d6610c11be571edd937e4570", + "verified-audit.json": "a5d496bb5f6d5518a5da2fd6ca3007934558860397a7678c8af8ee23a8d9b92d", + "decode.json": "36b84fbba56bd609f24f550124cd1417e67781eaa6a2401f152fb9f86641370b", + "performance.json": "5f806f713f00b794592899feb3b8188b352fb73052daf304d9026a1294801e17", + "train-protocol.json": "98c71cde7f8ab1bcdb9e05a814fd2c303a046cca51a0d8dfdc936c699da62cce" + } + }, "main_code_sha256": { "lisa_effect.py": "8a3ecad71f23e3e8b8faf4a7c21c0c93f00fd0bffe14bdee6117921b548dce8a", "lisa_tail.py": "4bd2c3c8690a8ae30cc1a9573ec17b7bbe25edf43a33507482719dc03cfeb9af", diff --git a/results/lisa-effect-reproduction/verified-audit.json b/results/lisa-effect-reproduction/verified-audit.json new file mode 100644 index 0000000..5ab16db --- /dev/null +++ b/results/lisa-effect-reproduction/verified-audit.json @@ -0,0 +1,297 @@ +{ + "selected_task": "lookup16", + "sites": [ + 19, + 23 + ], + "n": 32, + "arms": { + "native": { + "correct": 32, + "answer_nll_4": 0.1341308259358034, + "answer_nll_4_vs_direct": { + "mean_delta": 0.06131703549302525, + "paired_prompt_bootstrap_95": [ + 0.04199299138593708, + 0.07944046845013401 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "direct": { + "correct": 32, + "answer_nll_4": 0.07281379044277814, + "answer_nll_4_vs_direct": { + "mean_delta": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "linear": { + "correct": 32, + "answer_nll_4": 0.07204867493801925, + "answer_nll_4_vs_direct": { + "mean_delta": -0.0007651155047588842, + "paired_prompt_bootstrap_95": [ + -0.0011749581537977532, + -0.00035981557985461103 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "lisa": { + "correct": 32, + "answer_nll_4": 0.1846203565157959, + "answer_nll_4_vs_direct": { + "mean_delta": 0.11180656607301775, + "paired_prompt_bootstrap_95": [ + 0.09675488440532508, + 0.12821407122333472 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "lisa_answer_weighted": { + "correct": 32, + "answer_nll_4": 0.12601824456448818, + "answer_nll_4_vs_direct": { + "mean_delta": 0.05320445412171004, + "paired_prompt_bootstrap_95": [ + 0.03266015039585242, + 0.07493446492664697 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + } + }, + "prefill": { + "scope": "cached-prefix last layers, prefill", + "median_s": { + "native": 12.369724708609283, + "direct": 11.017615622840822, + "lisa": 16.311319678090513 + }, + "lisa_median_ratio_to_native": 1.3186485602818545 + }, + "decode": { + "scope": "isolated full-attention recipient, FP32, frozen true activations; excludes donor generation and full-model decode", + "sites": { + "19": { + "median_s_per_token": { + "native": 0.1361464262008667, + "lisa": 0.0963163236156106 + }, + "measured_kv_bytes": { + "native": 643072, + "lisa": 371776 + }, + "lisa_upstream_score_row_bytes": 5024, + "recipient_bytes_delta": -266272 + }, + "23": { + "median_s_per_token": { + "native": 0.13638535235077143, + "lisa": 0.1387955490499735 + }, + "measured_kv_bytes": { + "native": 643072, + "lisa": 371776 + }, + "lisa_upstream_score_row_bytes": 5024, + "recipient_bytes_delta": -266272 + } + } + }, + "full_vocab": { + "arms": { + "native": { + "correct": 27, + "answer_nll": 0.5633379220962524 + }, + "direct_23": { + "correct": 32, + "answer_nll": 0.31241124868392944 + }, + "lisa_23_ablation": { + "correct": 32, + "answer_nll": 0.2554302215576172 + }, + "direct_chain": { + "correct": 27, + "answer_nll": 0.5578678846359253 + }, + "lisa_chain": { + "correct": 32, + "answer_nll": 0.4706266522407532 + }, + "linear": { + "correct": 27, + "answer_nll": 0.5574188828468323 + }, + "lisa_answer_weighted": { + "correct": 32, + "answer_nll": 0.15454155206680298 + } + }, + "matched_direct_comparisons": { + "lisa_23_ablation": { + "baseline": "direct_23", + "answer_nll_delta": { + "mean_delta": -0.056981027126312256, + "paired_prompt_bootstrap_95": [ + -0.0759883001446724, + -0.03968979567289353 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "native": { + "baseline": "direct_chain", + "answer_nll_delta": { + "mean_delta": 0.0054700374603271484, + "paired_prompt_bootstrap_95": [ + -0.04259051829576492, + 0.05237825959920882 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "linear": { + "baseline": "direct_chain", + "answer_nll_delta": { + "mean_delta": -0.0004490017890930176, + "paired_prompt_bootstrap_95": [ + -0.002629266679286957, + 0.0016906306147575377 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 0, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.0, + "paired_prompt_bootstrap_95": [ + 0.0, + 0.0 + ], + "mcnemar_exact_p": 1.0 + }, + "lisa_answer_weighted": { + "baseline": "direct_chain", + "answer_nll_delta": { + "mean_delta": -0.4033263325691223, + "paired_prompt_bootstrap_95": [ + -0.47958737164735793, + -0.33443659693002703 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 5, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.15625, + "paired_prompt_bootstrap_95": [ + 0.03125, + 0.28125 + ], + "mcnemar_exact_p": 0.0625 + }, + "lisa_chain": { + "baseline": "direct_chain", + "answer_nll_delta": { + "mean_delta": -0.08724123239517212, + "paired_prompt_bootstrap_95": [ + -0.14977428913116456, + -0.030542241036891984 + ] + }, + "native_correct_lost_by_direct": 0, + "rescued": 0, + "newly_lost_among_native_and_direct_correct": 0, + "candidate_correct_direct_wrong": 5, + "direct_correct_candidate_wrong": 0, + "accuracy_delta_vs_direct": 0.15625, + "paired_prompt_bootstrap_95": [ + 0.03125, + 0.28125 + ], + "mcnemar_exact_p": 0.0625 + } + } + } +} -- 2.52.0