File size: 2,194 Bytes
2bcbc4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a9fe728
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---

language:
- en
license: apache-2.0
tags:
- gpt2
- pytorch
- causal-lm
- text-generation
- alpaca
- instruction-following
datasets:
- tatsu-lab/alpaca
base_model: koganrath/LiteGPT-Base
---


# LiteGPT-Instruct

This is a **124M parameter** Language Model (GPT-2 Small architecture) fine-tuned on the **Alpaca** dataset for instruction following.

It is part of the "Small Language Model (SLM)" project, trained from scratch on educational data (FineWeb-Edu) and then fine-tuned on instructions.

## Model Details

- **Architecture**: GPT-2 Small (12 layers, 12 heads, 768 embedding dim)
- **Parameters**: ~124 Million
- **Context Length**: 1024 tokens
- **Training**: 
  - **Pre-training**: 10B tokens from [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)
  - **Fine-tuning**: [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) dataset (Instruction Tuning)

## Usage

This model requires a specific prompt format to function correctly.

### Prompt Template (Alpaca)

```text

Below is an instruction that describes a task. Write a response that appropriately completes the request.



### Instruction:

{your_instruction}



### Response:

```

### Python Example

```python

from transformers import GPT2LMHeadModel, GPT2Tokenizer



model = GPT2LMHeadModel.from_pretrained("koganrath/LiteGPT-Instruct")

tokenizer = GPT2Tokenizer.from_pretrained("gpt2")



instruction = "List three primary colors."

prompt = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.



### Instruction:

{instruction}



### Response:

"""



inputs = tokenizer(prompt, return_tensors="pt")

outputs = model.generate(**inputs, max_new_tokens=50)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))

```

## Limitations

- **Size**: As a 124M parameter model, its reasoning capabilities are limited compared to larger models (7B+).
- **Hallucinations**: It may generate incorrect or nonsensical information.
- **Bias**: It inherits biases present in the FineWeb and Alpaca datasets.

## Authors

Trained by **koganrath** as part of the LiteGPT Project.