Skip to main content

Chain-of-Thought Optimized QKV Attention - Infini-Attention transformers with DeepSeek reasoner CoT optimization

Project description

M3 Ultra Display Laptop?? #pip

Estimated Training Time on Apple Silicon MPS: ~2h 37m

Details:

  • 22,325 training examples
  • 11.3M parameter model (infini-small)
  • 15 epochs, batch size 8
  • 2,791 batches per epoch (41,865 total)
  • 224 ms per batch
  • 5,455 tokens/second

The script is ready at train_v001.py. To run full training: python3 train_v001.py

Or with fewer epochs to speed it up: python3 train_v001.py --epochs 5 # ~52 minutes python3 train_v001.py --epochs 10 # ~1h 44m

mini - Agentic training pipeline controller

mini is a CLI that uses gpt-5.1-codex-mini to orchestrate the erosolar training pipeline, manage CoT training data quality, and handle deployment checks. It is implemented in mini_the_agentic_cli.py and drives local scripts plus API calls.

What mini does

  • Runs the full pipeline by invoking pipeline.py with a target master scalar and optional deploy.
  • Generates training data via generate_all_training_data.py (deprecated path) and trains the model via train.py.
  • Manages training samples in data_store/generated_training_data.jsonl (add/edit/delete/view with CoT diffs).
  • Embeds all CoT samples with text-embedding-3-small, computes the similarity "master scalar", and analyzes or optimizes CoT consistency.
  • Runs the "loser pickup" loop to add friends or update low-similarity samples using gpt-5.1-codex-mini.
  • Reports attention stats and last master scalar from data_store/generation_checkpoint.json.
  • Maintains conversation context with auto-squeeze and hot-swap between mini, 5.2, and 5.2-pro while preserving history.
  • Verifies deployments, tests API endpoints, runs system checks, and rebuilds/deploys to Cloud Run and Firebase.
  • Provides optional Tavily web search and general read/write/command tools for the agent.

Quick start

  1. Set your OpenAI API key.
  2. Start mini.
export OPENAI_API_KEY=...
python mini_the_agentic_cli.py

You can also store the key with --key or /key.

Wikipedia-style knowledge generator (titles only)

To create long, Wikipedia-style knowledge pairs without scraping article text:

python generate_wikipedia_knowledge.py --target 100 --resume

State is tracked in data_store/wiki_api_state.json, processed titles are logged in data_store/wiki_titles_seen.jsonl, and a persistent skip index lives at data_store/wiki_titles_seen.db. Output appends to data_store/generated_training_data.jsonl.

mini shortcuts:

  • /wiki runs the generator with --target -1 (all titles, resumable).
  • MINI_WIKI_TARGET overrides how many records mini generates per run (0 disables; <=0 means all).

Coding-only generator

To create a coding-only slice of training data each run:

python generate_coding_only.py --target 200 --resume

State is tracked in data_store/coding_only_state.json, seen prompts in data_store/coding_only_seen.db, and prompt logs in data_store/coding_only_prompts.jsonl.

mini shortcuts:

  • /coding runs the generator with --target -1 (all prompts, resumable).
  • MINI_CODING_TARGET overrides how many records mini generates per run (0 disables; <=0 means all).

Startup behavior

  • Runs a quick self-test unless --no-self-test is set.
  • Checks status on launch.
  • If models/erosolar is missing, runs the pipeline once (no deploy).
  • If Cloud Run or Firebase is not marked as deployed in version.json, triggers auto-deploy.

CLI shortcuts

python mini_the_agentic_cli.py --run
python mini_the_agentic_cli.py --status
python mini_the_agentic_cli.py --self-test
python mini_the_agentic_cli.py "generate 1000 records"
python mini_the_agentic_cli.py --no-auto
python mini_the_agentic_cli.py --no-self-test

Interactive commands

/help /status /run /generate /train /deploy /version /key /exit

You can also type natural language requests; mini decides which tools to run.

Data and state

mini reads and writes:

  • data_store/generated_training_data.jsonl (training samples)
  • data_store/cot_embeddings.json (CoT embeddings)
  • data_store/version.json (data stats)
  • data_store/generation_checkpoint.json (master scalar stats)
  • models/erosolar (trained model check)
  • version.json (erosolar version and deployment status)
  • ~/.agi/secrets.json (stored API key)
  • ~/.agi/mini_context.json (conversation context)

Dependencies and external tools

mini uses:

  • OpenAI Responses API and Embeddings API (requires OPENAI_API_KEY)
  • Python packages: aiohttp, httpx, numpy (API calls and embeddings) and rich (optional UI)
  • gcloud and firebase CLIs for deployment commands

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cot_optimized_qkv-0.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cot_optimized_qkv-0.1.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file cot_optimized_qkv-0.1.0.tar.gz.

File metadata

  • Download URL: cot_optimized_qkv-0.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cot_optimized_qkv-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3e4f87812b60673e5080ccfe8799e75bfe5801248bd5f79ed5aa8b282bbbddc
MD5 7e8e806b1ea745f8de7e4b298238e2b9
BLAKE2b-256 5695bae346c41dbd74c23d463cf97a7dac1ca9156ba2c2a24c991ae696e20b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cot_optimized_qkv-0.1.0.tar.gz:

Publisher: workflow.yml on CoT-Optimized-QKV/Provably-Adversarial-LLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cot_optimized_qkv-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cot_optimized_qkv-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cfc871d1943f81c1281d440e2764a4b9755cf609d5bbe946bc0ea8a6c003d4e
MD5 00ae6575d1eb5b53e2ca64b243477993
BLAKE2b-256 5549e35f2f9ec5ac7ad4269f1b91ac240260d56a46f72828ef926f08baa379ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for cot_optimized_qkv-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on CoT-Optimized-QKV/Provably-Adversarial-LLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page