Echoic-Lite
Bilingual (Chinese/English) character-level language model family β custom Transformer trained from scratch by eyanchao.
No HuggingFace Transformers dependency β pure PyTorch with SDPA, GQA, QK-Norm, Z-loss.
Models
| Version |
Params |
Dim |
Layers |
Heads |
KV Heads |
Status |
| v29 |
~1.0B |
1408 |
32 |
32 |
8 (GQA) |
π Training |
| v28 |
~480M |
1024 |
28 |
32 |
β |
β
Deployed |
| v27 |
~200M |
768 |
20 |
24 |
β |
π¦ Archived |
| v26 |
~60M |
512 |
14 |
16 |
β |
π¦ Archived |
Architecture (v29)
| Technique |
Description |
| GQA |
Grouped Query Attention (32Q / 8KV, ~30% VRAM saved) |
| QK-Norm |
RMSNorm on Q/K projections β training stability |
| Z-loss |
Logit L2 regularization β prevents explosion |
| SDPA |
PyTorch fused scaled_dot_product_attention |
| RoPE + SwiGLU + RMSNorm |
Llama-style architecture |
| Gradient checkpointing |
Per-layer activation recompute |
| torch.compile |
JIT with inductor disk cache |
| Layer-wise LR decay |
Higher layers learn slower (0.8Γ) |
| Dynamic LR |
Auto-half on loss spikes |
Training Data Mix
| Task |
Weight |
Sources |
| Math |
40% |
mathinstruct, school_math, math_large, math_sft |
| Code |
20% |
code_120k, code_large |
| Encyclopedia |
25% |
zh-wiki (5 partitions) |
| Stories |
15% |
TinyStories ZH/EN, story_instruct, story_punct |
| Identity |
SFT |
Custom dialogs Γ 50 |
Quick Start
import torch, os
from huggingface_hub import hf_hub_download
REPO = "eyanchao/echoic-lite"
tok = torch.load(
hf_hub_download(REPO, "bilingual-tokenizer.pt"),
map_location="cpu", weights_only=False
)
stoi, itos = tok.stoi, tok.itos
ckpt = torch.load(
hf_hub_download(REPO, "v28-best-e15.pt"),
map_location="cpu", weights_only=False
)
def encode(s): return [stoi.get(ord(c), 0) for c in s]
def decode(ids): return "".join(itos.get(k, "?") for k in ids)
prompt = "<|user|>δ½ ζ―θ°<|assistant|>"
x = torch.tensor([encode(prompt)], dtype=torch.long)
out = model.generate(x, max_new_tokens=100, temperature=0.7, top_k=40)
print(decode(out[0].tolist()))
Inference API
POST https://eyanchao--echoic-generate.modal.run
Body: {"prompt": "δ»εζδΈδΈͺ", "max_tokens": 200}
Files
| File |
Description |
v28-best-e15.pt |
v28 best (480M, deployed) |
v28-final.pt |
v28 final weights |
v29-best-e*.pt |
v29 checkpoints (1B, training) |
bilingual-tokenizer.pt |
Tokenizer |
Data
eyanchao/echoic-data
Evolution
v26 60M β v27 200M β v28 480M β v29 1B β ...
Weight expansion from v26βv28. v29 trained from scratch with GQA architecture.