File size: 4,516 Bytes
451288f
 
 
 
 
 
 
 
9100033
edf3601
9100033
edf3601
9100033
 
edf3601
 
9100033
 
 
edf3601
 
 
9100033
 
 
 
edf3601
 
 
 
9100033
 
 
 
 
 
 
 
 
 
edf3601
 
 
 
 
9100033
 
edf3601
 
 
 
 
 
 
 
 
9100033
edf3601
 
 
9100033
 
 
edf3601
 
 
9100033
 
 
 
 
 
 
 
 
edf3601
9100033
edf3601
9100033
edf3601
9100033
edf3601
9100033
edf3601
9100033
 
 
 
 
 
 
 
 
edf3601
 
 
9100033
 
 
 
edf3601
 
 
9100033
edf3601
9100033
 
 
edf3601
 
9100033
 
 
edf3601
 
 
9100033
edf3601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9100033
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
title: Outreach Message Generator
sdk: gradio
emoji: 🔥
colorFrom: indigo
colorTo: blue
short_description: This model is a fine-tuned version of google/gemma-2b traine
---
# Gemma-2B Fine-Tuned for Outreach Message Generation

## Model Description

This model is a fine-tuned version of **google/gemma-2b** trained to generate personalized LinkedIn outreach messages for business communication. The model takes contextual information about a prospect and generates a professional first-level outreach message suitable for networking or business development.
The model was fine-tuned using **parameter-efficient fine-tuning (LoRA)** with the **PEFT library** and **Hugging Face Transformers**. To reduce memory usage during training, **4-bit quantization using BitsAndBytes** was applied.
The model is designed to generate context-aware outreach messages based on structured inputs such as industry, company name, prospect designation, and background information.

---

## Intended Use

The model is intended for generating personalized outreach messages for:

- LinkedIn networking
- Sales outreach
- Business development communication
- Professional introduction messages

The model accepts structured contextual inputs and generates a professional outreach message based on the provided information.
Example input fields include:

- Prospect Name
- Designation
- Company
- Industry
- Prospect Background
- Sender Background

---

## Prompt Format

The model was trained using an instruction-style prompt-response format.

Example prompt structure:

PROMPT:

Generate a personalized LinkedIn message for {Prospect Name},
{Designation} at {Company} ({Industry})

Prospect Background:
{Prospect Background}

My Background:
{Sender Background}

RESPONSE:

The model generates a personalized outreach message as the response.

---

## Training Data

The training dataset consisted of structured outreach communication examples containing:

- Prospect Name
- Designation
- Company Name
- Industry
- Prospect Information
- Sender Information
- First-Level Outreach Message

The dataset was formatted into **prompt–completion pairs** to train the model in an instruction-following manner.

---

## Training Procedure

The model was fine-tuned using **Supervised Fine-Tuning (SFT)** with **LoRA adapters**.

### Key training configuration

- **Base Model:** google/gemma-2b  
- **Fine-Tuning Method:** LoRA (PEFT)  
- **Quantization:** 4-bit NF4 (BitsAndBytes)  
- **Optimizer:** paged_adamw_8bit  
- **Epochs:** 5  
- **Learning Rate:** 2e-4  
- **Batch Size:** 2  
- **Gradient Accumulation Steps:** 4  
- **Mixed Precision Training:** FP16  

LoRA adapters were applied to the transformer attention layers:

- `q_proj`
- `k_proj`
- `v_proj`
- `o_proj`

This enabled efficient fine-tuning while keeping most of the base model weights frozen.

---

## Evaluation

Basic evaluation was performed using generated responses compared against reference messages. **ROUGE metrics** were used to measure similarity between generated and reference messages.
The model demonstrates the ability to generate structured outreach messages that follow the tone and style of professional LinkedIn communication.

---

## Example Usage

Example Python inference code:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

model_name = "KirubaLS/gemma2b-merged1"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")

generator = pipeline("text-generation", model=model, tokenizer=tokenizer)

prompt = """
### PROMPT:
Generate a personalized LinkedIn message for John Doe,
Senior Data Engineer at Stripe (FinTech)

Prospect Background:
Works on payment infrastructure and scaling distributed systems.

My Background:
AI engineer building data intelligence platforms.

### RESPONSE:
"""

result = generator(prompt, max_new_tokens=200)
print(result[0]["generated_text"])
Limitations

The model may produce generic outreach messages when limited contextual information is provided. Output quality improves when richer contextual information is included in the prompt.

The model is intended for professional communication use cases and should be reviewed before sending messages in real-world scenarios.

License

This model follows the license of the base model google/gemma-2b.

Acknowledgements

This project was built using:

Hugging Face Transformers
PEFT (Parameter-Efficient Fine-Tuning)
BitsAndBytes quantization
PyTorch