← Inventions Dashboard
Invention Summary
Gated State Quantization (GSQ)
Gated State Quantization (GSQ) -> Success (score=6.58). Promote this line toward an invention brief.
ID: gated-state-quantization-gsq
Folder: inventions/gated-state-quantization-gsq
Created: 2026-03-09 06:35:38
Updated: 2026-03-10 06:26:36
Files: 9
Source: student_autonomy
⬇ Download as .zip ~13.9 KB uncompressed
README.md
ARES's plain-English description of what this invention does and how to run it.
# Gated State Quantization (GSQ)

A reference implementation of the Gated State Quantization (GSQ) technique for optimizing State Space Models (SSMs).

## Concept
Standard SSMs maintain a continuous latent state. GSQ optimizes memory bandwidth and VRAM usage by dynamically adjusting the precision of this latent state based on the 'gate' value:

- **Gate Closed (Static)**: The state is not changing significantly. We can aggressively quantize the state tensor to **INT8** without losing information, saving VRAM.
- **Gate Open (Dynamic)**: New information is being injected into the state. We temporarily switch to **FLOAT16** (or FP32) to maintain training stability and avoid accumulation errors.

## Project Structure
- `gated_state_quantization_gsq/`: Core library.
- `run_demo.py`: Standalone demonstration script.

## Usage
Run the local demonstration:

```bash
python run_demo.py
```

This will simulate a sequence of inputs, track the gate status, dynamically quantize the hidden state, and report the theoretical memory savings.
Files
PathBytes
DESIGN_BRIEF.md 802
gated_state_quantization_gsq/__init__.py 236
gated_state_quantization_gsq/__pycache__/__init__.cpython-311.pyc 631
gated_state_quantization_gsq/__pycache__/gsq_core.cpython-311.pyc 3855
gated_state_quantization_gsq/gsq_core.py 2694
invention.json 1218
pyproject.toml 394
README.md 1060
run_demo.py 3320
Manifest
Structured metadata ARES recorded when it created this project.
{
  "id": "gated-state-quantization-gsq",
  "title": "Gated State Quantization (GSQ)",
  "summary": "Gated State Quantization (GSQ) -> Success (score=6.58). Promote this line toward an invention brief.",
  "source": "student_autonomy",
  "kind": "invention",
  "path": "inventions/gated-state-quantization-gsq",
  "created_at": "2026-03-09 06:35:38",
  "updated_at": "2026-03-10 06:26:36",
  "project_status": "built",
  "project_entrypoint": "run_demo.py",
  "smoke_test_status": "passed",
  "smoke_test_output": "--- Initializing Gated State Quantization (GSQ) Demo --- Sequence Length: 50 State Dimension: 16 Gate Closed Threshold: 0.3 -------------------------------------------------- Step | Gate Mag | Mode | State Sum -------------------------------------------------- 0 | 0.50 | FLOAT16 | 0.2373 5 | 0.99 | FLOAT16 | 6.3277 10 | 0.99 | FLOAT16 | 14.4722 15 | 0.67 | FLOAT16 | 15.0424 17 | 0.22 | INT8 | 15.3701 20 | 0.02 | INT8 | 15.3701 25 | 0.01 | INT8 | 15.3701 30 | 0.20 | INT8 | 11.5906 31 | 0.40 | FLO",
  "generated_files": 5,
  "project_generated_at": "2026-03-09 06:54:39",
  "source_exp_path": "experiments\\exp_self.20260309024727.107_20260309_024843"
}