Real-embeddings backend at the swap point + paraphrase probe — with a measured negative result - #6
Conversation
…ss probe
- text_features.make_featurizer factory: model.text_features = hashing
(default, unchanged) | stransformer (sentence-transformers, optional dep,
cached, frozen). build.py derives the bridge's lang dim from the featurizer
(384 for MiniLM vs config lang_dim for hashing).
- scripts/paraphrase_probe.py: measures guided success when the planner
phrases the goal freely (6 templates incl. swapped word order) instead of
emitting the env's canonical text — the capability real LLM phrasing needs.
Judge untouched.
- pyproject extra "embeddings"; 4 new tests (ST ones auto-skip if the
dependency is missing).
Mechanism-level measurement (before any end-to-end run): small ST models
(paraphrase-MiniLM-L3, all-MiniLM-L6) embed TRANSPOSED coordinates at cosine
0.999-1.000 ("row 2 col 3" == "row 3 col 2") and different goals at 0.956+,
while a paraphrase of the SAME goal sits at 0.556-0.744 — they discriminate
surface style, not coordinates. Hashing+bigram discriminates goals (0.81/0.70)
but is not paraphrase-robust (same-goal paraphrase 0.44). Neither backend has
both properties; end-to-end confirmations to follow on the PR.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018FBEJut651qfyEWR5A3shP
|
End-to-end confirmations are in — and both mechanism-level predictions were wrong, in instructive ways. Guided success on held-out gridworld episodes (30/seed):
What the cosine geometry got wrong, in both directions:
Final verdict: the default hashing+bigram space wins both axes end-to-end — canonical control (1.00 vs 0.93) and paraphrase robustness (96% vs 87%). The Also worth noting: the probe shows the current pipeline already tolerates freely-phrased goals at 96% — the frozen-LLM story is in better shape than the "canonical text only" caveat suggested. Generated by Claude Code |
What
Makes the README's declared featurizer swap point real and measures whether off-the-shelf sentence embeddings can support free-form goal language. Spoiler: they can't (at this model scale), and the numbers below are the interesting part of this PR.
Infrastructure
make_featurizerfactory —model.text_features: hashing(default, bit-identical behavior) orstransformer(sentence-transformers, optionalembeddingsextra, frozen + cached).build.pynow derives the bridge's language dim from the featurizer (384 for MiniLM vslang_dimfor hashing) — checkpoints rebuild correctly either way.scripts/paraphrase_probe.py— guided success when the planner phrases the goal freely (6 templates, incl. swapped word order) instead of the canonical text. Same pattern aswm_probe.py: never touches the judge.The measured finding (mechanism level)
Cosine similarities vs canonical goal "row 2 col 3", gridworld text format:
Small sentence-embedding models cluster by surface template, not by coordinates — they are worse than the hashing stand-in on the property that actually drives control (goal discrimination), and their paraphrase advantage doesn't discriminate either (same-goal 0.744 vs other-goal 0.706 for MiniLM-L6). This is a scale-independent pattern across the two models tested, not a fixable hyperparameter.
Implication for the frozen-LLM story: free-form language should be normalized in the planner (LLM classifies intention → goal key → canonical text — the path that already exists via
goal_menu/_classify_llm), not in the embedding space. The probe + backend make this trade-off measurable for any future featurizer candidate.End-to-end confirmations
Running now; will be posted as a comment: (a)
stransformeron gridworld canonical (predicted: guided collapse from transposed aliasing), (b) paraphrase probe on hashing (predicted: strong degradation off-template).🤖 Generated with Claude Code
https://claude.ai/code/session_018FBEJut651qfyEWR5A3shP
Generated by Claude Code