Llama 3 8B — English → Hinglish Translation (LoRA)

Llama 3 8B Instruct fine-tuned with QLoRA to translate standard English into Hinglish — the romanized Hindi-English code-mixed register used in everyday informal communication across India.

Intended uses

  • Translating English text into natural, romanized Hinglish (chat, social, news summarization for Indian audiences).
  • Research on code-switched and low-resource NLP for South Asian languages.
  • A starting checkpoint for further fine-tuning on other code-mixed registers.

Out of scope: formal Hindi (Devanagari) translation; Hinglish → English (this model is unidirectional); safety-critical applications without human review.

How to use

pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
pip install --no-deps xformers trl peft accelerate bitsandbytes
from unsloth import FastLanguageModel
import torch

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct",
    max_seq_length=2048,
    dtype=None,          # auto-detect; float16 for T4/V100, bfloat16 for Ampere+
    load_in_4bit=True,
)

def translate(text):
    prompt = """Translate the input from English to Hinglish to give the response.

### Input:
{}

### Response:
"""
    inputs = tokenizer([prompt.format(text)], return_tensors="pt").to("cuda")
    outputs = model.generate(**inputs, max_new_tokens=2048, use_cache=True)
    raw = tokenizer.batch_decode(outputs)[0]
    return raw.split("### Response:\n")[1].split("<|eot_id|>")[0]

print(translate("This is a fine-tuned Hinglish translation model using Llama 3."))
# Yeh ek fine-tuned Hinglish translation model hai jo Llama 3 ka istemal karta hai.

GGUF quantizations are included in this repo for llama.cpp / Ollama use.

Training details

  • Method: QLoRA (4-bit) using Unsloth and HuggingFace TRL — approximately 2x faster training.
  • Data: English ↔ Hinglish sentence pairs from the News_Hinglish_English corpus (news domain).
  • Format: instruction-tuned prompt ("Translate the input from English to Hinglish").

Training loss:

Loss curve

Evaluation

Qualitative side-by-side with GPT-4o on held-out news text:

English input:

Finance Minister Nirmala Sitharaman said, "There used to be a poverty index...a human development index and all of them continue, but today what is keenly watched is VIX, the volatility index of the markets." Stability of the government is important for markets to be efficient, she stated. PM Narendra Modi's third term will make markets function with stability, she added.

GPT-4o:

Finance Minister Nirmala Sitharaman ne kaha, "Pehle ek poverty index hota tha...ek human development index hota tha aur yeh sab ab bhi hain, lekin aaj jo sabse zyada dekha ja raha hai, woh hai VIX, jo markets ka volatility index hai." Unhone kaha ki sarkar ki stability markets ke efficient hone ke liye zaroori hai. PM Narendra Modi ka teesra term markets ko stability ke saath function karne mein madad karega, unhone joda.

This model:

Finance Minister Nirmala Sitharaman ne kaha, "Pehle ek poverty index hota tha... ek human development index hota tha aur sab kuch ab bhi chal raha hai, lekin aaj jo kaafi zyada dekha ja raha hai, woh VIX hai, jo markets ki volatility ka index hai." Unhone kaha ki markets ke liye sarkar ki stability zaroori hai. PM Narendra Modi ke teesre term se markets stability ke saath function karenge, unhone joda.

Quantitative benchmarks (BLEU / chrF on a held-out test split, vs GPT-4o and base Llama 3 zero-shot) are in progress and will be added here.

Limitations & bias

  • Trained primarily on news-domain text; heavy slang or regional registers may be less natural.
  • Outputs romanized Hinglish only — no Devanagari.
  • Code-mixing ratio reflects the training corpus and may not match every audience's preference.
  • Inherits biases present in Llama 3 and the source news corpus.

Citation

@misc{agarwal2024newshinglish,
  author    = {Agarwal, Suyash},
  title     = {News\_Hinglish\_English: An English--Hinglish Parallel Corpus},
  year      = {2024},
  publisher = {Hugging Face},
  doi       = {10.57967/hf/5120},
  url       = {https://huggingface.co/datasets/suyash2739/News_Hinglish_English}
}

Downloads last month
410
GGUF
Model size
8B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct

Adapter
(183)
this model

Dataset used to train suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct

Collection including suyash2739/English_to_Hinglish_fintuned_lamma_3_8b_instruct