CoolFace
Modelpublic

Premchan369/Q-TensorFormer

sourceHugging Faceapache-2.0updated 10d agoView on Hugging Face
2likes185downloads
GENERATION_VALIDATION_REPORT.md57 linesDownload Raw Back to root
1# GENERATION VALIDATION REPORT: Autoregressive Decoding Audit2 3**Date**: September 17, 2026  4**Auditor**: Senior ML Systems Engineer & Research Software Auditor  5**Final Status**: **`GENERATION_PASS`**6 7---8 9## 1. Generation Interface Verification10 11The repository provides generation interfaces at two levels:121. **Model-Level Method**: `QTensorFormer.generate()` in `src/models.py` (with `AdaptiveKVCache`).132. **Hugging Face Integration**: `QTensorFormerForCausalLM` in `src/hf_model.py` (inherits `transformers.GenerationMixin`).143. **Pure PyTorch Greedy Loop**: Evaluated via standard causal next-token prediction `argmax(logits[:, -1, :])` directly on the model's `forward()` output contract.15 16---17 18## 2. Deterministic Reproducibility Audit19 20Deterministic greedy decoding was executed twice from identical initial input prompt `[10, 25, 30]` with `seed=42`:21 22### Test Run Comparison23- **`src.models.QTensorFormer`**:24  - Run 1 Tokens: `[10, 25, 30, 5278, 5278, 5278, 5278, 5278]`25  - Run 2 Tokens: `[10, 25, 30, 5278, 5278, 5278, 5278, 5278]`26  - Match: **100% Identical (Zero divergence)**27 28- **`q_tensor_former.QTensorFormer`**:29  - Run 1 Tokens: `[10, 25, 30, 2856, 1538, 2498, 2498, 2498]`30  - Run 2 Tokens: `[10, 25, 30, 2856, 1538, 2498, 2498, 2498]`31  - Match: **100% Identical (Zero divergence)**32 33---34 35## 3. Per-Token Sequence Growth & Dimension Trace36 37| Step | Current Sequence Length ($T$) | Logits Shape | Selected Next Token ID | Next Sequence Length ($T+1$) | Invariant Check |38| :---: | :---: | :---: | :---: | :---: | :---: |39| Prompt | 3 | N/A | N/A | 3 | Initial prompt |40| 1 | 3 | `[1, 3, 10000]` | $5278$ | 4 | **VALID** |41| 2 | 4 | `[1, 4, 10000]` | $5278$ | 5 | **VALID** |42| 3 | 5 | `[1, 5, 10000]` | $5278$ | 6 | **VALID** |43| 4 | 6 | `[1, 6, 10000]` | $5278$ | 7 | **VALID** |44| 5 | 7 | `[1, 7, 10000]` | $5278$ | 8 | **VALID** |45 46---47 48## 4. Verification Checklist49- [x] Input IDs semantics: Int64 tensor indexing within $[0, V-1]$.50- [x] Logits semantics: Real-valued unnormalized log-probabilities over vocabulary.51- [x] Next-token selection: Greedy argmax along vocabulary dimension.52- [x] Sequence growth: Monotonic single-token concatenation.53- [x] Determinism: Repeated execution with identical prompt and seed yields identical sequences.54- [x] Numerical stability: No NaN or Inf encountered during unrolling.55 56**FINAL STATUS**: **`GENERATION_PASS`**57