Views
No views yet
tinymqa1m vs Previous Variants| Feature / Metric | tiny1m (Standard) | tinybpe1m (BPE Variant) | tinymqa1m (This Repository) |
|---|---|---|---|
| Attention Mechanism | MHA (Multi-Head Attention) | MHA (Multi-Head Attention) | MQA (Multi-Query Attention) |
| Attention Heads ($N_{heads} / N_{kv_heads}$) | 2 Heads / 2 KV Heads | 2 Heads / 2 KV Heads | 4 Heads / 1 KV Head (Asymmetric) |
| Tokenizer Type | Simple Character-level | SentencePiece BPE | SentencePiece BPE |
| Byte Fallback Support | No | Yes (byte_fallback=True) | Yes (byte_fallback=True) |
llama2.c Compatibility | Fully Compatible (run.c) | Incompatible (Corrupts text) | Incompatible (Crashes/Corrupts) |
| Primary Debug Target | Core matrix multiplication & layout | byte_fallback decoder loop | KV-cache alignment & broadcast |
tinymqa1m?./)llama.cpp and compatible modern custom runtimes. The structural MQA hyper-parameters and specialized token layouts are fully baked into each GGUF binary:| Filename(s) / Wildcard Pattern | Type | Size | Purpose / Validation Target |
|---|---|---|---|
tinymqa1m.F32.gguf | F32 | ~4.0 MB | Baseline Test. Validates GGUF parsing, MQA tensor layout, matrix dimensions, and RoPE indexing without dequantization factors. |
tinymqa1m.F16.gguftinymqa1m.BF16.gguf | F16BF16 | ~2.0 MB | Half-Precision Test. Validates 16-bit float loading, tensor broadcasting, and structural inference stability. |
tinymqa1m.Q8_0.gguf | Q8_0 | ~1.1 MB | Quantization Level 1. Validates block-based uniform scaling with 32 elements under MQA dimensions. |
tinymqa1m.Q4_0.gguftinymqa1m.Q4_1.gguf | Q4_0Q4_1 | ~0.7 MB | Quantization Level 2. Validates classic 4-bit linear quantization and bit-unpacking logic. |
tinymqa1m.Q2_K.gguf | Q2_K | ~0.5 MB | Standard K-Quant (2-bit). Validates 2-bit super-block quantization parsing. |
tinymqa1m.Q3_K_*.gguf↳ tinymqa1m.Q3_K_S.gguf↳ tinymqa1m.Q3_K_M.gguf↳ tinymqa1m.Q3_K_L.gguf | Q3_K | ~0.6 MB | Standard K-Quant (3-bit). Validates Small, Medium, and Large sub-variants of 3-bit multi-block structures. |
tinymqa1m.Q4_K_*.gguf↳ tinymqa1m.Q4_K_S.gguf↳ tinymqa1m.Q4_K_M.gguf | Q4_K | ~0.7 MB | Standard K-Quant (4-bit). Validates Small and Medium sub-variants of modern 4-bit super-block structural parsing. |
tinymqa1m.Q5_K_*.gguf↳ tinymqa1m.Q5_K_S.gguf↳ tinymqa1m.Q5_K_M.gguf | Q5_K | ~0.8 MB | Standard K-Quant (5-bit). Validates Small and Medium sub-variants of 5-bit mixed precision super-blocks. |
tinymqa1m.Q6_K.gguf | Q6_K | ~0.9 MB | Standard K-Quant (6-bit). Validates 6-bit high-fidelity super-block quantization. |
tinymqa1m.IQ3_*.gguf↳ tinymqa1m.IQ3_XXS.gguf↳ tinymqa1m.IQ3_S.gguf | I-Quants | ~0.5 MB | Importance Quants (3-bit). Non-linear 3-bit importance quantization targeting lookup table (codebook) decoding logic. |
tinymqa1m.IQ4_*.gguf↳ tinymqa1m.IQ4_NL.gguf↳ tinymqa1m.IQ4_XS.gguf | I-Quants | ~0.6 MB | Importance Quants (4-bit). Non-linear 4-bit importance quantization variants (Non-Linear and Extra Small). |
tinymqa1m.TQ1_0.gguftinymqa1m.TQ2_0.gguf | Ternary | ~0.4 MB | Experimental. Ternary (-1, 0, 1) state quantization for cutting-edge engine testing. |
./hf/)transformers library:hf/model.safetensors: Unquantized native model parameters using explicit MQA structures.hf/config.json: Architectural settings specifying the asymmetrical head layout (num_attention_heads: 4, num_key_value_heads: 1).hf/generation_config.json: Default generation threshold boundaries.hf/tokenizer_config.json: Tokenizer behavior configuration enabling automatic <s> (BOS) injection and sequence padding boundaries.hf/special_tokens_map.json: Token mappings string keys directly to internal special token IDs.hf/tokenizer.model: The master 512-vocab SentencePiece tokenizer binary file.1./llama-cli -m tinymqa1m.Q4_K_M.gguf -p "Tom and Jerry are " -n 64 --temp 0.0
2tokenizer_config.json / special_tokens_map.json) fully populated, you can instantiate the configuration directly using standard Hugging Face components without custom workflow wrappers.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4repo_id = "shibatch/tinymqa1m"
5
6print("Loading tokenizer and MQA model configuration...")
7tokenizer = AutoTokenizer.from_pretrained(repo_id, subfolder="hf")
8model = AutoModelForCausalLM.from_pretrained(repo_id, subfolder="hf")
9
10device = "cuda" if torch.cuda.is_available() else "cpu"
11model = model.to(device)
12model.eval()
13
14prompt = "Tom and Jerry are "
15# Formatting and <s> (BOS) insertion are handled automatically via configuration metadata
16inputs = tokenizer(prompt, return_tensors="pt").to(device)
17
18print("Executing text generation loop (Validating MQA projection tensors)...")
19with torch.no_grad():
20 outputs = model.generate(
21 **inputs,
22 max_length=64,
23 do_sample=False
24 )
25
26generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
27
28print("\n--- Inference Test Result ---")
29print("Prompt :", prompt)
30print("Generated:", generated_text)
31byte_fallback enabled)hidden_size): 128num_hidden_layers): 4num_heads): 4 (head_dim = 32)num_kv_heads): 1 (Strict MQA broadcast ratio)intermediate_size): 352max_position_embeddings): 256llama2.c project.