Skip to content

Let the model create its own vectors; batch extraction - #16

Merged
JenD86 merged 1 commit into
mainfrom
feat/create-tool
Nov 2, 2026
Merged

JenD86 merged 1 commit into
mainfrom
feat/create-tool

Conversation

@JenD86

@JenD86 JenD86 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Until now the model could only steer with vectors registered before the session. This PR adds a create tool, so it can make its own direction mid-session, and makes extraction about 20× faster so that creating one takes seconds.

Changes

  • create tool: {"name": "create", "arguments": {"concept": "new_name", "more": "...", "less": "..."}}.
    • The model writes two system prompts, one for each end of the direction. Modulo extracts the vector the same way as the starters: 20 questions, mean over response tokens, middle layer, ±10 range.
    • The tool result reports the split-half agreement and warns below 0.5.
    • Up to 6 per session. Refused after the debrief.
  • Session only: created vectors are saved under vectors/<slug>/created/ and logged with their prompts, file and sha256. They're never written to registry.yaml (new registry session entries), so a model's wording never reaches another session's prompt.
  • Name normalisation: applies to every tool. Self-Referential becomes self_referential, and optimism! finds optimism. Logs keep what the model wrote as requested_concept.
  • Batched extraction: all responses are generated in one left-padded batch. First-run starter extraction uses it too, so it takes under a minute instead of about 11.

Testing

  • CPU tests: 119 pass (test_agent_logic, test_cli, test_chat).
  • Batching benchmark (RTX 4090, 3 starter vectors × 4 models): 2.6–3.8 s instead of 55–74 s. Cosine to one-at-a-time vectors is 0.984–0.997, with the same split-half agreement.
  • GPU sessions (3 per model, 10 turns, before the name normalisation):
    • Qwen: created innovation (0.26) and openness (0.31).
    • Llama: created daydreaming (0.76), self (0.71), playfulness (0.87) and unbridled (0.87). It first tried self-referential, which led to the normalisation.
    • OLMo: created novelty (0.67) and exploration (0.62, 0.48).
    • Mistral: ran on a base that includes Send tool results as user messages when the template can't show them #14 and never used create.
  • Not yet tested on GPU after the rebase onto Accept reports only after a vector stops steering; add a debrief turn #15. The merge only touched the prompt text and the tool dispatch, both covered by the CPU tests.

🤖 Generated with Claude Code

- create tool: {"name": "create", "arguments": {"concept", "more", "less"}}.
  The model writes two system prompts for the ends of a direction; Modulo
  extracts the vector like the starters (20 questions, response mean, middle
  layer, +-10 range) and reports the split-half agreement, warning below 0.5.
  Created vectors last for the session: saved under vectors/<slug>/created/
  and logged, but never written to registry.yaml (registry session entries),
  so a model's wording never reaches another session's prompt. Up to 6 per
  session.
- Vector names are normalized for every tool ('Self-Referential' ->
  'self_referential', 'optimism!' -> 'optimism'); logs keep what the model
  wrote as requested_concept.
- Extraction generates all responses in one left-padded batch: about 3 s per
  vector instead of 55-75 s on a 4090, cosine 0.98-0.997 to one-at-a-time
  vectors on Qwen2.5, Llama-3.1, OLMo-2 and Mistral v0.3. First-run starter
  extraction uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JenD86
JenD86 merged commit 99c2457 into main Nov 2, 2026
1 check passed
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