Text Generation
Transformers
Turkish
erk_linear
linear-attention
gated-deltanet
hybrid-attention
efficient-attention
turkish
erk
research
custom_code
conversational
Eval Results (legacy)
Instructions to use ecloudtech/Erk-Linear with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ecloudtech/Erk-Linear with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ecloudtech/Erk-Linear", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ecloudtech/Erk-Linear", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ecloudtech/Erk-Linear with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ecloudtech/Erk-Linear" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ecloudtech/Erk-Linear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ecloudtech/Erk-Linear
- SGLang
How to use ecloudtech/Erk-Linear with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ecloudtech/Erk-Linear" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ecloudtech/Erk-Linear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ecloudtech/Erk-Linear" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ecloudtech/Erk-Linear", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ecloudtech/Erk-Linear with Docker Model Runner:
docker model run hf.co/ecloudtech/Erk-Linear
| license: apache-2.0 | |
| base_model: | |
| - ecloudtech/Erk-14B | |
| - Qwen/Qwen3-14B | |
| language: | |
| - tr | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - linear-attention | |
| - gated-deltanet | |
| - hybrid-attention | |
| - efficient-attention | |
| - turkish | |
| - erk | |
| - research | |
| - custom_code | |
| inference: false | |
| model-index: | |
| - name: Erk-Linear | |
| results: | |
| - task: | |
| type: text-generation | |
| dataset: | |
| name: TurkishMMLU | |
| type: turkishmmlu | |
| metrics: | |
| - type: accuracy | |
| value: 68.1 | |
| name: "TurkishMMLU held-out 750 (oracle 68.8 — fark istatistiksel olarak anlamli degil, %95 GA [-2.9, +1.7])" | |
| # Erk-Linear | |
| **%20-lineer hibrit:** Erk-14B'nin 40 dikkat katmanından 8'i, subquadratic bir lineer-dikkat mekanizmasına ([Gated DeltaNet](https://github.com/fla-org/flash-linear-attention)) damıtılmıştır. Kalan 32 katman softmax "çıpa" olarak korunur. | |
| > **Gereksinim:** `trust_remote_code=True`, `flash-linear-attention` ve bir CUDA GPU'su. Mimari özeldir (`model_type: erk_linear`) ve Gated DeltaNet çekirdekleri Triton kullanır. | |
| > **Kod, protokol, teknik rapor:** [github.com/ecloudtechnology/erk-linear](https://github.com/ecloudtechnology/erk-linear) · **Temel model:** [Qwen3-14B](https://huggingface.co/Qwen/Qwen3-14B) | |
| ## Konumlandırma | |
| Bu, sıfırdan bir mimari değil, güçlü bir açık modelin üzerinde bir **mimari araştırmasıdır**: Türkçe bir dil modelinin dikkatinin ne kadarının, kaliteyi ölçülebilir biçimde bozmadan lineerleştirilebileceğini haritalayan bir çalışma. Sonuç, dört modern hibritin (Qwen3-Next, Kimi Linear, Jamba, Zamba) izlediği yolun muhafazakâr, kalite-öncelikli bir örneğidir. | |
| ## Sonuçlar (oracle vs %20-hibrit, aynı iç protokol, paired bootstrap %95 GA) | |
| | Değerlendirme | Erk (orijinal) | Erk-Linear | Fark | %95 GA | | |
| |---|---:|---:|---:|---:| | |
| | TurkishMMLU (held-out 750) ¹ | %68,8 | %68,1 | −0,7 | [−2,9 ; +1,7] | | |
| | TurkMorfBench (morfoloji) | %54,3 | %53,3 | −1,0 | [−3,9 ; +2,0] | | |
| | NIAH geri-çağırma (≤4K) | %100 | %100 | ±0 | — | | |
| | Perplexity (@512/@2048) | 1,00× | 1,03× | +%3 | — | | |
| İki benchmark'ta (MMLU, morfoloji) fark istatistiksel olarak anlamlı değildir. | |
| <sub>¹ TurkishMMLU, ko-eğitim checkpoint seçiminde kullanılan 150 sorunun **hariç** tutulduğu held-out 750 üzerinde raporlanır (seçim sızıntısı yok); tam 900'de fark −0,3'tür. Ham soru-bazlı tahminler [repoda](https://github.com/ecloudtechnology/erk-linear/blob/main/results/raw_predictions.json).</sub> | |
| **Verimlilik:** kısa-bağlam prefill'inde kazanç yoktur; uzun bağlamda KV-cache belleği azalır — 8 GDN katmanı sabit ~43 MB durum tuttuğu için net tasarruf bağlam uzadıkça %20'ye yaklaşır (4K'da −%14, 64K'da −%20 / ~2,1 GB; GDN durumu dahil ölçüldü). Ayrıntı: teknik rapor. | |
| ## Kullanım | |
| ```bash | |
| pip install torch transformers flash-linear-attention safetensors huggingface_hub | |
| ``` | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model = AutoModelForCausalLM.from_pretrained("ecloudtech/Erk-Linear", trust_remote_code=True) | |
| tok = AutoTokenizer.from_pretrained("ecloudtech/Erk-Linear") | |
| msg = [{"role": "user", "content": "Türkiye'nin başkenti neresidir?"}] | |
| ids = tok.apply_chat_template(msg, add_generation_prompt=True, return_tensors="pt").to(model.device) | |
| print(tok.decode(model.generate(ids, max_new_tokens=48)[0][ids.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| Hibrit iki kaynaktan kurulur: **gövde** (32 softmax katmanı + gömme/LM başı) [`ecloudtech/Erk-14B`](https://huggingface.co/ecloudtech/Erk-14B) deposundan, **8 GDN katmanı** bu depodan (`gdn_weights.safetensors`). `from_pretrained` ikisini birleştirip çalışır bir nedensel dil modeli döndürür — `.generate()`, sohbet şablonu ve `use_cache` standart biçimde çalışır. | |
| GDN sarmalayıcısı cache'li üretimde recurrent + convolution durumunu adımlar arası **devreder**; çıktı tam-yeniden-hesaplamayla (`use_cache=False`) sayısal gürültüye kadar aynıdır. Sarmalayıcı tek-dizi referans kullanım içindir; eş zamanlı/batch-paylaşımlı serviste her dizi için ayrı durum yönetimi gerekir. | |
| ## Sınırlamalar | |
| - %20 lineer — muhafazakâr, kalite-öncelikli bir orandır (kayıpsıza-yakın sınır ~%22; ötesi kapasite duvarına çarpar). | |
| - TurkishMMLU checkpoint'i 150 MMLU-probe sorusuyla seçildi; sonuç bu sorular hariç held-out 750'de raporlanır. | |
| - Değerlendirme iki benchmark + iki kontrolle sınırlıdır; ≥16K uzun-bağlam geri-çağırma ve decode hızı gelecek iştir. | |
| - Referans loader tek-dizi kullanım içindir (eş zamanlı/batch servis ayrı durum yönetimi gerektirir). | |
| - Erk, Qwen3-14B üzerine kuruludur. | |
| ## Lisans | |
| Apache-2.0 (kod). Ağırlıklar temel modelin lisansına tabidir. | |
| ## Teşekkür | |
| Erk-Linear'ın geliştirme ve değerlendirme süreçleri, **AI EDIH Türkiye** projesi kapsamında tahsis edilen kaynaklarla İstanbul Teknik Üniversitesi **Ulusal Yüksek Başarımlı Hesaplama Merkezi (UHeM)** altyapısında yürütülmüştür. Değerli destekleri için UHeM ekibine ve AI EDIH Türkiye konsorsiyumuna teşekkür ederiz. | |