Quarks Base-0.1
π Research paper β QMA v0.1 Technical Report
Read the full research paper (PDF)
Read the Markdown version Β· Citation metadata Β· References
This technical report documents the QMA v0.1 architecture, QTK v0.1 tokenizer, Kaggle training procedure, measured validation results, held-out language audit, generation failures, limitations, and the proposed QMA-Next research direction. It is an unreviewed technical report, not a peer-reviewed publication.
Repository DOI: 10.57967/hf/11807. This DOI identifies the Hugging Face model repository; it is not a separately assigned DOI for the technical report.
Quarks Base-0.1 is the first pretrained research checkpoint in the Quarks coding-model project. It was initialized randomly and trained with the custom Quarks Tokenizer (QTK) and the first Quarks Mathematical Architecture (QMA) implementation.
Release status: Public research artifact and reusable baseline for future Quarks/QMA architecture experiments. This is a small, early-stage base modelβnot an instruction-tuned assistant and not a production coding model.
Why this checkpoint exists
This checkpoint is preserved as a baseline for developing and evaluating the next Quarks mathematical architecture. Future QMA variants may reuse compatible tensors from this checkpoint as initialization, while newly introduced or shape-incompatible modules will be initialized separately. The original Base-0.1 checkpoint and code should remain unchanged so experiments can be compared reproducibly.
Model summary
- Architecture: QMA v0.1 (first Quarks architecture implementation)
- Parameters: 31,190,408
- Layers: 8
- Hidden width: 384
- Attention heads: 6
- Feed-forward width: 1,024
- Configured maximum context: 1,024 tokens
- First training run sequence length: 512 tokens
- Local attention window: 128 tokens
- Global-memory chunk size: 64 tokens
- Global-memory slots per chunk: 4
- Tokenizer: QTK v0.1
- Vocabulary: 32,000 tokens
- Initialization: random; no pretrained third-party model was used
- Training: 800 optimizer steps on Kaggle T4Γ2, AdamW, FP16 autocast
- Effective token-position exposure reported by the training loop: 13,107,200
Architecture
The first QMA implementation combines:
- causal local attention with RoPE;
- chunk-compressed global memory;
- learned local/global routing;
- RMSNorm;
- SwiGLU feed-forward blocks; and
- tied token-embedding/output weights.
The implementation is in modeling_quarks.py; the configuration is in qma_config.json. This documents the Base-0.1 architecture only. It does not imply that future QMA designs must keep the same equations or module structure.
Training data and provenance
The first training run used 20,000 selected source-code documents from bigcode/the-stack-smol: 2,500 documents for each of Python, C, C++, Rust, JavaScript, TypeScript, Java and Go. The training manifest records the following license allowlist: 0BSD, Apache-2.0, BSD-2-Clause, BSD-3-Clause, CC0-1.0, ISC, MIT, Unlicense and Zlib.
The allowlist is a filtering rule, not a blanket license for the resulting checkpoint. The Stack's terms state that use of source code from the dataset must respect each file's original license, including attribution clauses where relevant. See:
- The Stack Smol dataset card and access terms
- BigCode explanation of The Stack licensing and data governance
The repository includes qtk_provenance.jsonl and data_manifest.json to support audit and reproducibility. The source dataset itself is not redistributed here. Users must not assume that the allowlist or the presence of provenance automatically resolves all model-weight redistribution questions.
Evaluation and known limitations
Recorded measurements from the initial experiment:
- Artifact-export sampled validation estimate: approximately 4.4094.
- Separate deterministic validation sample: cross-entropy 4.439838 over 262,144 token positions (seed
20261123), perplexity approximately 84.76. - Preliminary held-out per-language cross-entropy from 12 documents per language: Python 5.1042; C 5.0874; C++ 4.7111; Rust 3.8101; JavaScript 4.6827; TypeScript 4.8655; Java 4.4566; Go 4.2462.
- Initial greedy generation showed repetition and cross-language syntax contamination.
- Initial Python syntax validation failed.
- No HumanEval, MBPP, SWE-bench or other functional coding benchmark is claimed as passed.
The per-language held-out sample is small and should be treated as diagnostic, not as a stable benchmark ranking. The model has not demonstrated reliable code generation.
Intended use
Intended for:
- research on compact code-language models;
- experiments with QMA mathematical architectures;
- checkpoint transfer into future Quarks/QMA variants where tensor compatibility is verified;
- tokenizer and pretraining-pipeline research; and
- reproducible comparison against later Quarks checkpoints.
Do not use generated code in production or safety-critical systems without independent review and testing. Run untrusted generated code only in an isolated sandbox.
Loading Base-0.1
Install torch, safetensors and tokenizers, then:
from load_quarks import load_quarks
model, tokenizer = load_quarks(".")
The loader reconstructs the tied output head. The safetensors file stores the shared embedding tensor once.
Using Base-0.1 to initialize a future QMA architecture
See QMA_NEXT_ARCHITECTURE_PLAN.md and qma_transfer_utils.py.
The intended workflow is weight transfer, not an unconditional strict resume:
- pin the Base-0.1 Hub revision and keep the original checkpoint immutable;
- instantiate the new architecture with its own configuration and fresh initialization;
- copy only explicitly approved parameters whose names, shapes and mathematical roles are compatible;
- report every loaded, skipped and shape-mismatched tensor;
- verify tied embeddings and forward/gradient/casuality tests; and
- start a fresh optimizer/scheduler for the new architecture.
A matching shape alone does not prove that two tensors have the same meaning. The transfer allowlist must be reviewed for every new QMA design.
Licensing status
This repository is publicly accessible. Public visibility is not itself a license grant.
- Original Quarks implementation files listed in
CODE_LICENSE_SCOPE.mdare released under Apache-2.0, subject to the scope stated there. - No blanket license is assigned by this patch to
model.safetensors, QTK artifacts, or the trained model as a whole. The checkpoint was trained on third-party source code whose original license terms remain relevant. The project owner must complete a file-level rights/attribution review before publishing an open license for the weights and tokenizer. - No third-party dataset contents are intentionally included as a separate corpus in this model repository.
Do not treat this release as an unrestricted open-weight grant until the model-artifact license is explicitly added after that review. See MODEL_ARTIFACT_LICENSE_STATUS.md and DATASET_ATTRIBUTION_AND_REVIEW.md.