tokens-as-parameters
其他 活跃维护

tokens-as-parameters

BruceLoveLee000/tokens-as-parameters

支持将Token作为可优化参数,在推理阶段无需更新模型权重即可让固定权重语言模型动态适配任务,实现推理时学习,有效降低模型微调成本与部署开销。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
3
Open Issues
TypeScript
主要语言
Apache-2.0
开源协议
428 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:BruceLoveLee000/tokens-as-parameters
git clone https://github.com/BruceLoveLee000/tokens-as-parameters.git
git clone git@github.com:BruceLoveLee000/tokens-as-parameters.git
README.md main

Tokens as Parameters

English | 简体中文

Tokens Are All You Need — If You Can Optimize Them.

Can a fixed-weight language model learn during inference?

Tokens as Parameters is an experimental system for studying whether persistent textual state can function as inference-time adaptive parameters. It uses parallel reasoning trajectories, verifiable feedback, comparative reflection, textual updates, and context consolidation to optimize an agent's future behavior without changing model weights.

Our first research testbed is long-horizon hardware formal verification with Lean and DeepSeek Harness.

Not every token is a parameter. A token becomes parameter-like when it is optimized from evidence, retained across future decisions, and measurably changes the model's action distribution.

Status

Research preview. The first release is intentionally experiment-only. It runs repository-versioned immutable Cases, materializes a fresh Run-owned Git workspace for each invocation, and never edits or merges back into the Case. Production operation on user-selected workspaces is deferred to Issue #4.

The DSH-native formal-proof system is a workspace of independent Core, Formal, Lean, Tool, and Bundle packages targeting the 0.1.1-rc.2 public extension APIs. It provides isolated parallel provers, verifier-gated Git checkpoints, a replaceable token Optimizer, declaration-level consolidation, durable run evidence, and final white-box review.

Research question

Given fixed model weights, can a verifier-guided optimizer update persistent textual state so that later trajectories achieve higher expected reward under an equal inference budget?

Implemented first slice

  • DSH-native orchestration over the official Code Agent and Agent Loop.
  • A packages/core/optimization kernel where domain Agents register versioned text parameters, select feedback eligibility per instance, record exact context exposure, and accept atomic semantic updates from replaceable Optimizers.
  • Parallel, isolated reasoning trajectories with persistent run identity.
  • Verifier-gated trusted progress and reward-hacking defenses.
  • Comparative reflection as a directional textual update.
  • Git-backed evidence, cognitive state, and transition history.
  • Lean and hardware formal verification as the first verifier adapter and benchmark family.

The Bundle deliberately does not ship another Code Agent, Agent Loop, chat UI, shell, filesystem, compactor, or token meter. Those remain owned by official DSH.

Quick start

Prerequisites: Node.js ^22.19 or >=24, DSH 0.1.1-rc.2, Git, and a Lean project managed by Lake.

npm ci
npm run check
npm run pack:local
dsh plugin --profile web add ./tokens-as-parameters-*.tgz
dsh web

Launch DSH from this checkout so the default Case catalog resolves to ./benchmarks, then write this in a DSH Code Agent conversation:

/chip_proof lean-smoke-positive

The integration translates this convention into the model-facing chip_proof({ case_id }) tool. The Runtime accepts only an exact registered Case id—not an arbitrary workspace path. It checks that the Case is committed, copies it to .tokens-as-parameters/runs/<runId>/workspace, validates the locked hashes again, and initializes a new Git baseline before any Prover starts. The official DSH Session UI remains the trajectory surface; the Bundle additionally persists run.json and events.jsonl for every Run.

See the Core architecture and Optimizer provider contract, Bundle guide, formal architecture, and FDIV reproduction protocol.

Next research work

  • Run the licensed FDIV R14 checkpoint end to end through the packaged Bundle.
  • Add reward-oriented context consolidation rather than generic summarization.
  • Execute equal-budget ablations across single-agent, independent-parallel, self-reflection, group-reflection, persistent-insight, and consolidation conditions.
  • Add user-workspace production mode only after the experiment path is stable (Issue #4).

Repository map

packages/       DSH plugins, runtime services, and verifier adapters
benchmarks/     Versioned cases with per-case provenance and licensing
experiments/    Reproducible protocols, ablations, and result schemas
docs/           Theory, architecture, research notes, and reports

Licensing

  • Software and original code examples: Apache License 2.0.
  • Documentation and original research figures under docs/: CC BY 4.0.
  • Benchmark cases: licensed per case; every case must include provenance and a license manifest.
  • Contributions: Apache-2.0 under Developer Certificate of Origin 1.1 sign-off.

See LICENSE, NOTICE, docs/LICENSE.md, and CONTRIBUTING.md.