File size: 2,722 Bytes
978c674
 
 
 
 
 
 
 
 
 
 
 
 
 
df98534
978c674
 
 
 
 
 
 
 
 
 
 
1dfa55f
 
 
978c674
 
 
 
 
1dfa55f
 
 
 
 
 
 
 
978c674
 
 
 
 
 
1dfa55f
 
978c674
 
 
 
 
1dfa55f
 
978c674
 
1dfa55f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
978c674
 
1dfa55f
 
 
 
978c674
 
1dfa55f
 
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
---
license: mit
library_name: transformers
tags:
- reward-model
- reranking
- literary-style
- faithfulness
- longformer
pipeline_tag: text-classification
---

# LongformerRM-Unison

Absolute multi-head reward model for literary writing.

## Heads
This model outputs 3 logits in this order:

1. `style`
2. `faith`
3. `identifier`

Apply sigmoid to each logit to obtain scores in `[0, 1]`.

## Intended use
This model can be used in two ways:

### 1. Rewrite scoring (primary use)
Score a `(source passage, rewrite)` pair for:
- stylistic quality
- semantic/content faithfulness
- identifier preservation (names, dates, numbers, protected spans)

### 2. Standalone chunk scoring (experimental workaround)
Score a single passage chunk by pairing it with a **synthetically corrupted but grammatical pseudo-source** derived from that same chunk.

In this mode:
- `style_score` is still meaningful
- `faith_score` and `identifier_score` become **proxy scores relative to the synthetic pseudo-source**
- the resulting overall score is a **proxy chunk-ranking score**, not a true rewrite-faithfulness score

## Important
This is **not** a comparative Bradley-Terry reward model.  
It is an **absolute scorer**. Score each candidate independently, then sort externally.

## Input format
Use exactly:

```text
### Original Draft:
{prompt}

### Rewritten Version:
{response}
````

For Longformer inference, set `global_attention_mask[:, 0] = 1`.

## Rewrite scoring

For normal rewrite evaluation, use the real source passage as `prompt` and the candidate rewrite as `response`.

## Standalone chunk scoring

If you only have a passage chunk and no source passage, the recommended workaround is:

* generate a **synthetically corrupted, flatter, still grammatical** version of the chunk
* place that synthetic corruption in `Original Draft`
* place the real chunk in `Rewritten Version`

This better matches the model’s training format than an empty prompt.

### Caveat

In standalone chunk mode, `faith` and `identifier` are **not true faithfulness metrics**. They only measure agreement with the synthetic corrupted prompt.

## Recommended composite score for rewrite scoring

```python
overall_score = style_score * (0.5 * faith_score + 0.5 * identifier_score) * (identifier_score ** 1.5)
```

## Recommended score for standalone chunk scoring

You can rank by:

* `proxy_overall_score` if using a synthetic corrupted prompt
* or just `style_score` if you want the simplest signal

The synthetic-prompt method usually produces more separation between chunks than an empty-prompt style-only setup.

## Output head order

```python
[style_logit, faith_logit, identifier_logit]
```

## Base model

`allenai/longformer-base-4096`