Views
No views yet
Artha (Sanskrit: अर्थ) — meaning "essence", "purpose", "meaning"
| Prompt Type | English Tokens | Artha Tokens | Saving |
|---|---|---|---|
| Summarisation | 12 | 3 | 75% |
| Code fix | 12 | 3 | 75% |
| Email generation | 14 | 3 | 79% |
| Comparison | 10 | 4 | 60% |
| Explanation | 11 | 3 | 73% |
| Average | 12 | 3 | 73% |
fmt:bullets as 4 tokens.
An Artha tokenizer sees it as 1.
The model doesn't translate — it thinks natively in Artha.1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5# Load base model
6base = AutoModelForCausalLM.from_pretrained(
7 "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
8 torch_dtype=torch.bfloat16,
9 device_map="auto"
10)
11
12# Load Artha tokenizer and resize embeddings
13tokenizer = AutoTokenizer.from_pretrained("siddsukh/artha-1.1b")
14base.resize_token_embeddings(len(tokenizer), mean_resizing=False)
15
16# Load LoRA adapter
17model = PeftModel.from_pretrained(base, "siddsukh/artha-1.1b")
18model.eval()
19
20def compress(prompt):
21 input_text = f"<|artha|>\n{prompt}\n<|compress|>\n"
22 inputs = tokenizer(input_text, return_tensors="pt").to(
23 next(model.parameters()).device
24 )
25 with torch.no_grad():
26 outputs = model.generate(
27 **inputs,
28 max_new_tokens=64,
29 do_sample=False,
30 pad_token_id=tokenizer.eos_token_id,
31 )
32 decoded = tokenizer.decode(outputs[0], skip_special_tokens=False)
33 return decoded.split("<|compress|>")[-1].split("<|end|>")[0].strip()
34
35# Example
36print(compress("Please summarise this in 3 bullet points, focus on facts"))
37# → sum[this](#3, fmt:bullets) +facts1@misc{artha2025,
2 author = {Siddhantsukhatankar},
3 title = {Artha: A Token-Efficient Math-Based Language for Human-AI Communication},
4 year = {2025},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/siddsukh/artha-1.1b}
7}