Joe Cooper commited on
Commit
5da31cb
·
1 Parent(s): d131bbe

First upload.

Browse files
Files changed (5) hide show
  1. README.md +54 -0
  2. config.json +42 -0
  3. model.safetensors +3 -0
  4. spm.model +3 -0
  5. tokenizer_config.json +4 -0
README.md CHANGED
@@ -1,3 +1,57 @@
1
  ---
 
 
 
 
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language: en
3
+ tags:
4
+ - deberta
5
+ - deberta-v3
6
  license: mit
7
  ---
8
+
9
+ # Cross Talk
10
+
11
+ ## Multiturn Conversation by Reranking.
12
+
13
+ Cross Talk is a [DeBERTa V3 Large](https://huggingface.co/microsoft/deberta-v3-large) finetune designed to identify which outgoing text candidates best follow conversational history. It is trained on a "next-like, not next-like" corpus derived from Open Subtitles. It was intended for _recreational use._
14
+
15
+ ## Concept
16
+
17
+ Suppose we have the following exchange in a conversational history:
18
+
19
+ ```
20
+ [user] I'm out of coffee.
21
+ [bot] What will you do about it?
22
+ [user] I guess I'll buy more.
23
+ ```
24
+
25
+ And by some generative model, we have three candidate texts:
26
+
27
+ 1. `Buy more what?`
28
+ 2. `Is it expensive?`
29
+ 3. `Colorless green ideas sleep furiously.`
30
+
31
+ We should be able to score item 2 as the most ideal, and item 3 as the least ideal.
32
+
33
+ ## Motivation
34
+
35
+ This is a product of [an experiment](https://joecooper.me/blog/crosstalk/) to
36
+ run multiturn conversational AI entirely by reranking of candidates.
37
+
38
+ In the experiment, a Markov text generator produces wholly random candidates
39
+ with no regard to user input. These candidates are then scored by the model.
40
+ The trained model acts exclusively as a judge.
41
+
42
+ ## Input / Output
43
+
44
+ Elements are scored pointwise; the model should identify whether a given
45
+ candidate in isolation fits the context. To this end, the model is trained
46
+ on context + candidate pairs. The context is presented as series of lines,
47
+ concatenated together using a `|` pipe (token id `1540`), like so:
48
+
49
+ ```
50
+ [cls] line | line | … [sep] candidate [sep] [pad] …
51
+ ```
52
+
53
+ Output is a single logit.
54
+
55
+ ## Training
56
+
57
+ Model was trained for 40 hours on a single Nvidia 3090, on 130m tokens of content from Open Subtitles with some pruning and processing of the data. The model scores 92% on the test set, derived from content unrelated to the training set.
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DebertaV2ForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "dtype": "float32",
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 1024,
10
+ "id2label": {
11
+ "0": "LABEL_0"
12
+ },
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 4096,
15
+ "label2id": {
16
+ "LABEL_0": 0
17
+ },
18
+ "layer_norm_eps": 1e-07,
19
+ "legacy": true,
20
+ "max_position_embeddings": 512,
21
+ "max_relative_positions": -1,
22
+ "model_type": "deberta-v2",
23
+ "norm_rel_ebd": "layer_norm",
24
+ "num_attention_heads": 16,
25
+ "num_hidden_layers": 24,
26
+ "pad_token_id": 0,
27
+ "pooler_dropout": 0,
28
+ "pooler_hidden_act": "gelu",
29
+ "pooler_hidden_size": 1024,
30
+ "pos_att_type": [
31
+ "p2c",
32
+ "c2p"
33
+ ],
34
+ "position_biased_input": false,
35
+ "position_buckets": 256,
36
+ "problem_type": "single_label_classification",
37
+ "relative_attention": true,
38
+ "share_att_key": true,
39
+ "transformers_version": "4.57.0",
40
+ "type_vocab_size": 0,
41
+ "vocab_size": 128100
42
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fd20627d3656d85c5cf2357a369265501af1a85d1cee5d5cdefa0705aca44bd
3
+ size 1740300340
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "do_lower_case": false,
3
+ "vocab_type": "spm"
4
+ }