--- license: apache-2.0 language: - en pipeline_tag: text-generation tags: - kaila - decoder-only - causal-lm - gqa - rope - transformers - language-model - text-generation --- # KAIL F2 **Developer:** Kaniskten Programming KAIL F2 is a ~1.1B-parameter decoder-only causal language model built on the **KailA** transformer architecture. It is designed for text generation and autoregressive completion, with a configured 131,072-token context window. ## Model Details | Attribute | Value | |---|---| | **Model name** | KAIL F2 | | **Developer** | Kaniskten Programming | | **Architecture** | KailA (`KailAForCausalLM`) | | **Model type** | `kail` | | **Task** | Causal Language Modeling | | **Parameters** | 1,123,372,800 (~1.12B) | | **Dtype** | BF16 | | **Layers** | 24 | | **Hidden size** | 1536 | | **Attention heads** | 16 | | **Key/value heads** | 2 | | **Attention type** | Grouped-Query Attention (GQA) | | **Head dimension** | 128 | | **Intermediate size** | 4608 | | **Context length** | 131,072 | | **Vocabulary size** | 130,560 | | **RoPE theta** | 5,000,000 | | **License** | Apache-2.0 | --- ## Overview KAIL F2 is a causal language model. Given a text prefix, it generates a continuation token by token. The model is released as open weights under the **Apache-2.0** license for experimentation, research, local inference, and application development. KAIL F2 is part of the **KailA** model architecture developed by Kaniskten Programming. --- ## KailA Architecture KAIL F2 uses **KailA**, a decoder-only transformer architecture designed around efficient autoregressive inference while adding lightweight adaptive components. ### Core architecture - **Grouped-Query Attention (GQA)** — 16 query heads share 2 key/value heads, reducing KV-cache memory requirements. - **Rotary Position Embeddings (RoPE)** — configured with `theta = 5,000,000` and a maximum sequence length of 131,072. - **Adaptive Attention Controller** — a lightweight context-dependent module that produces attention scaling factors. - **Feature Router** — a lightweight routing/modulation component that adjusts the gated feed-forward pathway according to the current representation. - **RMSNorm** — used for pre-normalization. - **SwiGLU** — gated feed-forward network. - **KV caching** — supported for autoregressive generation. - **Scaled Dot-Product Attention** — supported through PyTorch attention implementations where available. ### Architecture summary ```text Input Tokens │ ▼ Token Embeddings │ ▼ ┌─────────────────────────────┐ │ KailA Transformer │ │ │ │ RMSNorm │ │ ↓ │ │ GQA Attention + RoPE │ │ ↓ │ │ Adaptive Attention Control │ │ ↓ │ │ Residual │ │ ↓ │ │ RMSNorm │ │ ↓ │ │ SwiGLU + Feature Router │ │ ↓ │ │ Residual │ └─────────────────────────────┘ │ ▼ Final RMSNorm │ ▼ Language Model Head │ ▼ Next-Token Probabilities ``` --- ## Hugging Face Usage The model provides its KailA reference implementation and is loaded through the Hugging Face Transformers API. ### Requirements Tested with: ```bash pip install "transformers>=5.14.0" accelerate torch ``` ### Basic generation ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "Kaniskten/Kail_F2" tokenizer = AutoTokenizer.from_pretrained( model_id, trust_remote_code=True, ) model = AutoModelForCausalLM.from_pretrained( model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True, ).eval() prompt = "The capital of France is" inputs = tokenizer(prompt, return_tensors="pt").to(model.device) with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=64, ) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` > **Note:** `trust_remote_code=True` is required because the repository contains the KailA model implementation used by Transformers. ### Sampling The packaged generation path supports common generation controls including: ```python outputs = model.generate( **inputs, max_new_tokens=128, temperature=0.7, top_p=0.9, top_k=50, repetition_penalty=1.05, ) ``` For deterministic generation, use greedy decoding without sampling parameters. --- ## Generation Notes - `max_new_tokens` controls the maximum number of newly generated tokens. - Pass `eos_token_id=tokenizer.eos_token_id` when explicit EOS stopping is desired. - The tokenizer uses: - `` — BOS - `` — EOS / padding - `` — unknown token - Start from a raw prompt or use the repository's available chat-template configuration where appropriate. - Actual usable context depends on available system memory/VRAM and the generation workload; the configured maximum is 131,072 tokens. --- # Benchmarks The benchmark results below are the **measured KAIL F2 results currently available for this release**. They should be treated as directional measurements rather than a universal ranking. Evaluation was performed locally with `lm-evaluation-harness` 0.4.13 using BF16 inference on a single consumer GPU. ## Standardized Evaluation | Benchmark | KAIL F2 | | ------------- | ------- | | MMLU | 50.3 | | ARC-Easy | 58.0 | | ARC-Challenge | 62.6 | | HellaSwag | 46.2 | | Winogrande | 59.2 | | GSM8K | 43.2 | | TruthfulQA | 49.77 | | PIQA | 50.6 | | OpenBookQA | 38.2 | | BoolQ | 65.4 | ### Benchmark methodology - Non-MMLU tasks were evaluated on a 500-example sample. - MMLU used up to 20 questions per subject. - Results are therefore approximate and should not be interpreted as full-dataset leaderboard scores. - HumanEval is not reported because the required code-execution metric was unavailable on the evaluation platform. - A sampled overlap check between the training corpus and benchmark items found a small number of exact matches. This means benchmark results should be interpreted with appropriate caution. - Llama-3.2-1B-Instruct and Gemma-3-1B-it were not included in the scored comparison because the required model access was unavailable in the evaluation environment. ### Benchmark interpretation KAIL F2 is a relatively small model and its benchmark results should be interpreted in the context of its approximately 1.12B parameter size and its current training/evaluation setup. These results are published for transparency. They are **not presented as state-of-the-art claims**. --- ## Performance A separate local BF16 generation measurement produced approximately: | Metric | KAIL F2 | |---|---:| | Generation speed | ~50 tokens/s | | Peak VRAM | ~4 GB | | Precision | BF16 | | Batch size | 1 | | Decoding | Greedy | | Hardware | Consumer NVIDIA GPU | Performance varies with prompt length, generated-token count, PyTorch/Transformers versions, GPU utilization, KV-cache size, and generation settings. These measurements are provided as practical reference values rather than guaranteed performance specifications. --- ## GGUF Quantizations KAIL F2 is available in multiple GGUF formats for local inference. Quantization reduces model size and memory requirements, with trade-offs in numerical precision and output quality. | Quantization | File | Size | Validation | |---|---|---:|---| | F16 | `fp16/KAIL-F2-F16.gguf` | 2.25 GB | PASS | | F32 | `fp32/KAIL-F2-F32.gguf` | 4.49 GB | PASS — lossless reference | | Q2_K | `q2_k/KAIL-F2-Q2_K.gguf` | 540 MiB | **PASS** | | Q3_K_M | `q3_k_m/KAIL-F2-Q3_K_M.gguf` | 633 MiB | **PASS** | | **Q4_K_M** | `q4_k_m/KAIL-F2-Q4_K_M.gguf` | **733 MiB** | **PASS — recommended compact quant** | | **Q5_K_M** | `q5_k_m/KAIL-F2-Q5_K_M.gguf` | **827 MiB** | **PASS** | | **Q6_K** | `q6_k/KAIL-F2-Q6_K.gguf` | **927 MiB** | **PASS** | | **Q8_0** | `q8_0/KAIL-F2-Q8_0.gguf` | **1177 MiB** | **PASS — highest-quality tested quant** | ### Recommended Downloads - **Q4_K_M:** Best starting point for a compact download. - **Q5_K_M:** Alternative with a larger file size. - **Q6_K:** Higher-precision quantization option. - **Q8_0:** Highest-quality tested quantization in this release. - **F16 / F32:** Reference formats requiring more storage and memory. ### GGUF verification All GGUF files were checked for: - Correct KAIL F2 metadata and `kail` architecture identification. - 435 tensors with expected names and shapes. - No NaN or Inf values in weights or generated output. - Valid EOS behavior and successful generation. - Byte-identical GGUF chat template compared with the repository template. - SHA256 checksums recorded for release verification. - The canonical BF16 checkpoint remaining untouched. KailA control-path tensors remain in F16 during quantization, while normalization/bias tensors retain the required higher precision. > **Generation note:** The canonical model exhibits an immediate-EOS behavior for the identity prompt under greedy decoding. This also appears in the GGUF variants and is a model-level behavior rather than a GGUF loading failure. Sampling at temperature 0.7 produced the expected KAIL F2 identity for Q4_K_M, Q5_K_M, Q6_K, and Q8_0. ### GGUF SHA256 | File | SHA256 | |---|---| | `KAIL-F2-F16.gguf` | `BAECC98EC93630A5A6938986E5C65F198408D640BAB45E8EA32B157E84E2878F` | | `KAIL-F2-F32.gguf` | `9C4E390CEAA5BA7B9AC4039007AEE34E68667004B57D34CECB3C13F4555DEC80` | | `KAIL-F2-Q2_K.gguf` | `296F25C5AE286258F64C61173ECAC7B360DFA95826ADEB9773E74E83981000C9` | | `KAIL-F2-Q3_K_M.gguf` | `C293168EC1964C6E1B7FE0F1AE43E6CBED2FB5D0FE34CAEAD22B8E43F6E732A7` | | `KAIL-F2-Q4_K_M.gguf` | `AF55B890DD95CA94BFFCD4AF7C11B320E096E906E3C27AD42E8ED98CE02649F6` | | `KAIL-F2-Q5_K_M.gguf` | `B2E60C9DD59ABB5EFECF0EEF48FC55FDF87C40B1E26A2120144447C639B6D2AE` | | `KAIL-F2-Q6_K.gguf` | `668BB61D2B5491B7FE951B591FECF6CA677D01726B13C2D4E610572AFD24F78A` | | `KAIL-F2-Q8_0.gguf` | `61C6C1D8A6FA37FB49ECB84A2FBB34F81DBDCA58233DEABCFE7145DE75C0FE22` | --- ## Intended Use KAIL F2 is intended for: - Text generation - Autoregressive completion - Interactive experimentation - Local AI applications - Research and development - Testing the KailA architecture - Lightweight language-model inference --- ## Limitations KAIL F2 is a relatively small language model and should not be treated as a general-purpose expert system. Known limitations include: - The model can generate plausible but incorrect information. - Mathematical and reasoning performance can be inconsistent. - Benchmark coverage is limited. - Long-context capability depends strongly on available hardware. - The published benchmark set is not a complete evaluation of all capabilities. - Performance outside the evaluated English tasks is not characterized by this release. - The model has not been evaluated for high-stakes deployment. - Generated content should be reviewed before being relied upon. --- ## Safety KAIL F2 is provided for research, development, experimentation, and general text-generation applications. Do not use the model as the sole basis for: - Medical decisions - Legal decisions - Financial decisions - Safety-critical control - Other high-stakes decisions Users are responsible for evaluating and monitoring model outputs in their applications. --- ## Model Identity The public model identity is: ```text Model: KAIL F2 Developer: Kaniskten Programming Architecture: KailA Model Class: KailAForCausalLM Model Type: KAIL Task: Causal Language Modeling ``` --- ## Repository Structure The Hugging Face release contains the model weights, tokenizer, configuration, and KailA implementation required for local Transformers inference. The canonical model repository is: ```text Kaniskten/Kail_F2 ``` --- ## Citation If you use KAIL F2 in research, software, demonstrations, or published work, please cite: ```bibtex @misc{kailf2, title = {KAIL F2}, author = {Kaniskten Programming}, year = {2026}, url = {https://huggingface.co/Kaniskten/Kail_F2} } ``` --- ## License KAIL F2 is released under the **Apache License 2.0**. See the `LICENSE` file in this repository for the complete license text. --- ## Developer **Kaniskten Programming** KAIL F2 is part of the Kail AI model family and is developed by Kaniskten Programming.