Skip to content

test(longmemeval): temporal date-window boost (#1119) - #1125

Closed
ajianaz wants to merge 2 commits into
test/1118-lmeval-foundationfrom
test/1119-temporal-boost
Closed

ajianaz wants to merge 2 commits into
test/1118-lmeval-foundationfrom
test/1119-temporal-boost

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • temporal.py: regex-based temporal expression parser resolving phrases ("last month", "10 days ago", "four weeks ago", "last week", "between February and April", "in March", "before/after June") into a concrete (lo, hi) window anchored on question_date
  • boost_ranking(): additive RRF boost (+0.0022 default) for sessions inside the window
  • run_eval.py: --temporal flag (default OFF), --temporal-boost knob
  • modal_fast50.py: temporal flag propagated via shard spec (env vars don't reach Modal workers); volume cache variant-keyed (hybrid vs hybrid_temporal) to prevent stale resume
  • test_temporal.py: 21 unit tests (parser + boost math), all passing

Why

Temporal reasoning is the single largest measured gap (12.8 Q-worth of k10→k5 loss in the 500Q run). Sessions with relevant dates systematically lose to old distractors because embeddings cannot see dates. A harness-side date-window boost is zero-model post-processing — consistent with the single-model (EmbeddingGemma) decision; no new downloads, no runtime deps. Default OFF preserves baseline behavior for A/B.

Testing

  • python3 test_temporal.py → 21/21 PASS (incl. between-wrap fix, boost boundary math)
  • python3 run_eval.py --help → flags present
  • Offline risk audit on fast50: 3/50 questions parseable, all answers in-window (0 danger cases), 1 rescue target at rank ~15 (r@50=1.0, r@5=0.0)
  • Modal fast50 A/B (paired, 43Q, same binary v0.15.0 + EmbeddingGemma):
    • Overall R@5: 0.9200 → 0.9267 (+0.67pp)
    • Overall R@10: 0.9767 → 0.9923 (+1.56pp)
    • temporal-reasoning R@5: 0.7821 → 0.8077 (+2.56pp)
    • Questions improved: 1 (gpt4_8279ba03 rescued from r@5=0.0 → 1.0), regressed: 0

@ajianaz ajianaz changed the title test(longmemeoral): temporal date-window boost (#1119) test(longmemeval): temporal date-window boost (#1119) Aug 27, 2026
- temporal.py: temporal expression parser -> (lo,hi) window; patterns:
  last-N, N-days/weeks-ago (digits+words), last week/month, between X-Y,
  before/after month, in-month, this month/year
- boost_ranking(): additive RRF boost for in-window sessions
- run_eval.py: --temporal flag (default OFF) + --temporal-boost (0.0022)
- modal_fast50.py: bake temporal.py into image; LMEVAL_TEMPORAL=1 passthrough
- test_temporal.py: 21 unit tests (parser + boost math), all passing
…volume cache

Two bugs in the A/B harness found before burning Modal credits:
- LMEVAL_TEMPORAL was read at module level inside the container, so the
  env var never reached the worker: a --temporal run would silently
  execute the baseline. The flag now travels through the shard spec.
- Shard cache keyed only by strategy: a temporal shard would resume
  from the stale 470Q baseline volume entry. Volume paths are now
  variant-keyed (hybrid vs hybrid_temporal).
@ajianaz
ajianaz force-pushed the test/1119-temporal-boost branch from d6dd72c to db6b5ff Compare August 27, 2026 03:25
@ajianaz
ajianaz deleted the branch test/1118-lmeval-foundation August 27, 2026 04:54
@ajianaz ajianaz closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant