Skip to content

feat(llada): add target-hidden behavioral scores - #412

Open
hxu129 wants to merge 4 commits into
brain-score:mainfrom
hxu129:codex/llada-brainscore-behavior-v2
Open

hxu129 wants to merge 4 commits into
brain-score:mainfrom
hxu129:codex/llada-brainscore-behavior-v2

Conversation

@hxu129

@hxu129 hxu129 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds reading_times to the existing llada-8b-base plugin so it can run Futrell2018 and SyntaxGym. The published layer-24 neural readout is unchanged.

Scoring contract

The adapter tokenizes the visible prefix independently, then scores each new subtoken left to right with one appended mask. It sums surprisal in bits, skips empty SyntaxGym regions in subsequent context, and uses a window of 4,095 observed tokens plus the mask. The pinned checkpoint's last_logits_only path computes only the mask output. next_word is outside this PR's scope. The returned surprisal is a reading-time proxy.

Validation

  • Plugin and integration checks passed on the current PR head. The unit tests cover registration, target hiding, subtoken scoring, and empty regions.
  • With the pinned checkpoint, the optimized output head agreed with full logits on top-1 predictions at three tested lengths, with total variation below 1e-4.
  • Local benchmark runs completed: Futrell2018 over 10,256 non-empty words (r = 0.245143, ceiling-normalized 0.285700) and SyntaxGym over 31 suites (mean 0.683732, or 0.673190 across the 30 suites shown on the public leaderboard). Official behavioral scoring is pending.

Run the plugin tests with pytest -q brainscore_language/models/llada8b/test.py -m 'not memory_intense'. The plugin README documents the checkpoint revision and LLADA_MODEL_PATH for checkpoint-based runs.

Review

The diff is limited to models/llada8b. The fork checkout fix landed separately in #414, and change detection passed. The main review question is whether the fixed one-mask policy is appropriate for the platform's reading_times interface.

Two edge cases remain in the current head: a combined neural/behavioral call can share context metadata even when punctuation normalization differs, and overlength neural input can be truncated. Fixes and regression checks have been validated locally and are separate from the results above.

AI assistance: Codex assisted with implementation, test preparation, and the PR description. The checks above were run on the submitted adapter.

@hxu129

hxu129 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Update (2026-09-28): Both this PR and Dream PR #413 are now ready for review. The full local Futrell and corrected SyntaxGym evaluations have completed, with the scores and scientific boundaries in each PR description. The independent integration, plugin unit-test, and documentation checks are green.

Both PRs still fail at Plugin Submission Orchestrator / 1. Detect Changes because the workflow checks out github.event.pull_request.head.ref from the upstream repository rather than from the fork that owns the branch. The workflow has additional head.ref checkout steps later, so the complete fork path may need review after the first step is corrected. I do not have push permission to brain-score/language, so an upstream-owned branch is not available from this account.

Could a maintainer make the submission workflow fork-aware or advise an approved manual route for these two ready PRs? I will treat the scores as local benchmark results until the official scoring jobs and website publication are verified.

Follow-up: I opened the minimal workflow fix in PR #414. Its Detect Changes job passed on that real fork PR, including changed-file detection and is_fork_pr=true; independent checks are green. Please review #414 when possible so #412/#413 can be retriggered against the fixed workflow.

@hxu129
hxu129 marked this pull request as ready for review September 28, 2026 15:11
@KartikP KartikP self-assigned this Sep 29, 2026
@KartikP KartikP changed the title Add target-hidden behavioral scoring for LLaDA-8B Base feat(llada): add target-hidden behavioral scores Nov 8, 2026
KartikP added a commit that referenced this pull request Nov 8, 2026
The PR validator can report success after timeout when required statuses
never arrive, because it excludes missing results from the final check.
Require explicit success for all four contexts and reject results if the
PR head changes during validation.

Run the status validator for fork plugin submissions using trusted base
code and a read-only token. Keep label writes restricted to eligible
non-fork web submissions, and make the Actions job fail when validation
fails. Accept the polling options already used by the metadata workflow.

Validation: 31 focused tests passed, including absent statuses, pending
results, failures, changed heads, and existing Jenkins trigger behavior.
Workflow YAML structure and git diff checks passed. Read-only checks of
#412 and #413 matched their current successful status contexts.
Checkpoint tests and official benchmark execution remain separate from
this status validator.
@KartikP KartikP added ci-verification Temporary label for deployed CI verification and removed ci-verification Temporary label for deployed CI verification labels Nov 8, 2026
KartikP added a commit that referenced this pull request Nov 8, 2026
Live verification after #441 merged found that #412 and #413 execute the
new validation job but load the old helper from their original base SHA,
97a086a. That revision predates the fail-closed validator, so green
validation jobs do not verify the deployed repair.

Check out the current base branch explicitly from the upstream
repository instead of the PR event's original base SHA. Keep the
checkout read-only and separate from the contributor's submitted head.
Log the validation-code SHA alongside the submitted SHA so future
verification can confirm both.

Validation: 31 focused tests passed; workflow YAML and trusted checkout
fields verified; git diff checks passed. Runtime changes are limited to
the workflow checkout and its documentation; a local Git regression test
covers the source-selection boundary. Model code, benchmark behavior,
Jenkins build-state policy, and account handling are unchanged.

Verification evidence:
- LLaDA:
https://github.com/brain-score/language/actions/runs/42520523395/job/128853266652
- Dream:
https://github.com/brain-score/language/actions/runs/42520525641/job/128853325777

Both logs show checkout of 97a086a while checking the correct submitted
head. After merge, rerun the label-triggered workflow and confirm that
the helper checkout includes #441 and that the validator reports current
status contexts with head_matches=true.


## Regression proof before merge

Added a test that reads the actual workflow YAML and performs checkouts
in isolated local Git repositories. The upstream repository has an old
base commit and a current validator commit. A separate fork replaces the
helper with code that raises if executed. The PR event retains the old
base SHA.

- With the #441 workflow: 3 tests fail and 1 passes. The checkout
selects obsolete code, and missing-status/new-head safeguards are
absent.
- With the #442 workflow: all 35 focused tests pass, including the four
checkout integration tests.
- The selected helper accepts complete statuses only for the submitted
fork SHA, rejects missing statuses and a changed head, and never
executes the fork helper.
- No network, GitHub, Jenkins, or AWS calls occur in this regression.
- actionlint 1.7.12 reports 16 existing findings on both workflow
versions; this change introduces none. These existing lint findings are
not claimed as resolved.

After CI executes the new regression, review the change before merge.
For the final live check, first confirm that each PR merge ref contains
the new workflow, then trigger one run and require the logs to identify
the current trusted helper SHA and the correct submitted head SHA. A
skipped validator or an old helper SHA is a failed verification,
regardless of the workflow's overall green status.

This branch has not been deployed

No deployments
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.

2 participants