File size: 2,179 Bytes
1c35206
 
 
 
 
 
 
 
 
 
 
 
54de477
 
 
1c35206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
language:
- en
tags:
- prompt-optimization
- query-rewriting
- spikewhale
- escarda
pipeline_tag: text-generation
---

<img src="Escarda-LLMs.png" width="50%">


# Escarda-Rewrite (86M)

**Escarda-Rewrite** is an 86M-parameter prompt optimizer. Given a raw user question it
rewrites it into a detailed, role-grounded **instruction prompt** for a downstream LLM —
a persona declaration, a clear task framing, and clarifying questions.

It is part of the **Escarda** line (JEPA SpikeWhale backbone, vocab 16,512) and is designed
to pair with [`Quazim0t0/Escarda-86M-Identity`](https://huggingface.co/Quazim0t0/Escarda-86M-Identity)
as the downstream answerer: **user query → Escarda-Rewrite → optimized prompt → Escarda-Identity → answer.**

## Example

| Raw query | Escarda-Rewrite output |
|---|---|
| How do I lower my cholesterol? | *As a Senior Medical Expert, your task is to provide clear, concise guidance on lowering cholesterol… Begin by declaring your persona… Next, ask clarifying questions…* |
| How do I grow tomatoes? | *As an Agricultural Scientist, your task is to provide clear guidance on growing tomatoes… Begin by introducing yourself…* |
| What are my rights if I am fired? | *As a Senior Legal Advisor, your task is to provide guidance on… Begin by declaring your persona…* |

## Usage

```python
from rewrite import EscardaRewrite
rw = EscardaRewrite(".")            # loads model + tokenizer from this repo
print(rw.rewrite("How do I lower my cholesterol?"))
```

## How it was built

Escarda-Rewrite was trained to match, and is **benchmarked against**, the prompt-optimization
behaviour of **QueryShield-1.5B** (`ml-intern-explorers/queryshield-1.5b`) — a 1.5B prompt
optimizer — at ~1/17th the size, using a balanced, topic-roled corpus so the chosen expert
persona tracks the topic of the query (Medical, Legal, Financial, Agricultural, Software,
Data Science, Marketing, Education, Research, …).

## Citation

Created by **Dean Byrne** (Quazim0t0).

```bibtex
@misc{byrne2026escardarewrite,
  title  = {Escarda-Rewrite: an 86M prompt optimizer},
  author = {Byrne, Dean},
  year   = {2026}
}
```