Llama-3.2-1B-NarthananMath_1M-V1

A 1-billion parameter language model.

Model Details

Model Description

  • Developed by: Narthanan
  • Model type: Decoder-only Causal Language Model
  • Language(s) (NLP): English, Math
  • License: Use of Llama 3.2 is governed by the Llama 3.2 Community License (a custom, commercial license agreement).
  • Finetuned from model: unsloth/Llama-3.2-1B-Instruct
  • Finetuning Data: Narthanan/NarthananMath_1M-V1

Uses

Direct Use

This model is intended for direct use in applications requiring mathematical reasoning, such as:

  • Step-by-step math problem solving
  • Generating mathematical explanations and proofs
  • Translating word problems into equations

Out-of-Scope Use

The model is not intended for, and its performance may be degraded on:

  • General chat or open-ended dialogue without a mathematical focus
  • Generating factual information about non-mathematical topics (history, current events, etc.)
  • Medical, legal, or financial advice
  • Any application requiring guaranteed, verifiable correctness without human oversight.

Bias, Risks, and Limitations

Limitations:

  • Verification Required: As with all language models, its mathematical outputs should be carefully verified, especially in high-stakes or educational settings.
  • Scope: Performance is optimized for mathematical reasoning and may be weaker on other general knowledge tasks compared to the base model.
  • Potential Biases: The model may inherit and amplify biases present in its base model and fine-tuning data. Its "knowledge" and problem-solving approach will reflect the distribution of its training examples.

Recommendations Users should be aware of the model's specialized nature and always apply critical evaluation to its outputs. It is best used as an assistive tool alongside human expertise.

How to Get Started with the Model

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_name = "Narthanan/Llama-3.2-1B-NarthananMath_1M-V1"

print("loading model...")
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)

print(f"Running on {device}. You can now interact with the model.")

while True:
    user_input = input("You: ")
    if user_input.lower() in ["exit", "quit"]:
        break

    inputs = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt").to(device)

    with torch.no_grad():
        output_tokens = model.generate(
            inputs,
            max_length=2000,
            do_sample=True,
            top_k=50,
            top_p=0.95,
            pad_token_id=tokenizer.eos_token_id,
            temperature=0.6
        )

    response = tokenizer.decode(output_tokens[:, inputs.shape[-1]:][0], skip_special_tokens=True)
    
    print(f"Model: {response}")
Downloads last month
6
Safetensors
Model size
1B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Narthanan/Llama-3.2-1B-NarthananMath_1M-V1

Finetuned
(439)
this model

Dataset used to train Narthanan/Llama-3.2-1B-NarthananMath_1M-V1