🧠 Task 001: Quantum-Guided Token Selection Loop (Prototype) #1

Open
opened 2025-05-28 14:38:59 +00:00 by rileyseaburg · 1 comment
rileyseaburg commented 2025-05-28 14:38:59 +00:00 (Migrated from github.com)

🧠 Task 001: Quantum-Guided Token Selection Loop (Prototype)

Objective
Create the initial end-to-end inference loop for Coheron that combines a local language model with a quantum coherence filter.


📋 Task Description

Implement a minimal working prototype that performs the following:

  • Generates token candidates from a local language model.
  • Converts each candidate into a quantum-encoded state.
  • Runs a Qiskit circuit to evaluate coherence/interference.
  • Scores token candidates based on the quantum result.
  • Selects the final token using the coherence score.
  • Logs the prompt, candidates, scores, and selection result.

🧩 Subtasks

  • Rust: Inference Engine

    • Load a local GPT model (e.g. distilgpt2) using ONNX or HF bindings.
    • Generate the top-N next-token candidates from a prompt.
    • Extract embeddings for each candidate.
  • Bridge Layer

    • Serialize token data and embeddings.
    • Pass data from Rust → Python (e.g. via JSON over pipe or socket).
  • Python: Quantum Layer

    • Accept input tokens and their embeddings.
    • Encode embeddings as quantum states.
    • Evaluate each token in a Qiskit harmonic oscillator or interference circuit.
    • Return coherence scores per token.
  • Rust: Scoring & Selection

    • Re-rank or filter tokens using coherence scores.
    • Select and output the final token.
    • Log all relevant output to JSON file.

✅ Acceptance Criteria

  • End-to-end flow completes successfully on a local machine.

  • Output includes:

    • Prompt
    • Token candidates
    • Coherence scores
    • Final token selection
  • Log is stored at ./data/logs/{timestamp}.json with the following format:

{
  "prompt": "The truth is",
  "candidates": [
    { "token": "revealed", "score": 0.94 },
    { "token": "hidden", "score": 0.67 },
    { "token": "lost", "score": 0.31 }
  ],
  "selected_token": "revealed",
  "timestamp": "2025-05-28T23:04:00Z"
}

🔗 Dependencies

  • Hugging Face Transformers or ONNX model for GPT
  • Qiskit installed and IBM Quantum account configured
  • Inter-process communication working between Rust and Python
### 🧠 Task 001: Quantum-Guided Token Selection Loop (Prototype) **Objective** Create the initial end-to-end inference loop for Coheron that combines a local language model with a quantum coherence filter. --- #### 📋 Task Description Implement a minimal working prototype that performs the following: * Generates token candidates from a local language model. * Converts each candidate into a quantum-encoded state. * Runs a Qiskit circuit to evaluate coherence/interference. * Scores token candidates based on the quantum result. * Selects the final token using the coherence score. * Logs the prompt, candidates, scores, and selection result. --- #### 🧩 Subtasks * [ ] **Rust: Inference Engine** * [ ] Load a local GPT model (e.g. `distilgpt2`) using ONNX or HF bindings. * [ ] Generate the top-N next-token candidates from a prompt. * [ ] Extract embeddings for each candidate. * [ ] **Bridge Layer** * [ ] Serialize token data and embeddings. * [ ] Pass data from Rust → Python (e.g. via JSON over pipe or socket). * [ ] **Python: Quantum Layer** * [ ] Accept input tokens and their embeddings. * [ ] Encode embeddings as quantum states. * [ ] Evaluate each token in a Qiskit harmonic oscillator or interference circuit. * [ ] Return coherence scores per token. * [ ] **Rust: Scoring & Selection** * [ ] Re-rank or filter tokens using coherence scores. * [ ] Select and output the final token. * [ ] Log all relevant output to JSON file. --- #### ✅ Acceptance Criteria * [ ] End-to-end flow completes successfully on a local machine. * [ ] Output includes: * Prompt * Token candidates * Coherence scores * Final token selection * [ ] Log is stored at `./data/logs/{timestamp}.json` with the following format: ```json { "prompt": "The truth is", "candidates": [ { "token": "revealed", "score": 0.94 }, { "token": "hidden", "score": 0.67 }, { "token": "lost", "score": 0.31 } ], "selected_token": "revealed", "timestamp": "2025-05-28T23:04:00Z" } ``` --- #### 🔗 Dependencies * [ ] Hugging Face Transformers or ONNX model for GPT * [ ] Qiskit installed and IBM Quantum account configured * [ ] Inter-process communication working between Rust and Python
rileyseaburg commented 2025-07-27 00:44:53 +00:00 (Migrated from github.com)

@copilot please show the test results

@copilot please show the test results
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
riley/coheron#1
No description provided.