Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,119 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
datasets:
|
4 |
+
- TIGER-Lab/SKGInstruct
|
5 |
+
language:
|
6 |
+
- en
|
7 |
---
|
8 |
+
# 🏗️ StructLM: Towards Building Generalist Models for Structured Knowledge Grounding
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
Project Page: [https://tiger-ai-lab.github.io/StructLM/](https://tiger-ai-lab.github.io/StructLM/)
|
13 |
+
|
14 |
+
Paper: [https://arxiv.org/pdf/2402.16671.pdf](https://arxiv.org/pdf/2402.16671.pdf)
|
15 |
+
|
16 |
+
Code: [https://github.com/TIGER-AI-Lab/StructLM](https://github.com/TIGER-AI-Lab/StructLM)
|
17 |
+
|
18 |
+
|
19 |
+
![Alt text](https://raw.githubusercontent.com/TIGER-AI-Lab/StructLM/gh-pages/static/images/thumbnail.drawio.png)
|
20 |
+
|
21 |
+
|
22 |
+
## Introduction
|
23 |
+
StructLM, is a series of open-source large language models (LLMs) finetuned for structured knowledge grounding (SKG) tasks.
|
24 |
+
|
25 |
+
This model is trained using Mistral as the base model, instead of CodeLlama.
|
26 |
+
|
27 |
+
## Training Data
|
28 |
+
This model is trained on 🤗 [SKGInstruct-skg-only Dataset](https://huggingface.co/datasets/TIGER-Lab/SKGInstruct-skg-only). Check out the dataset card for more details.
|
29 |
+
|
30 |
+
## Training Procedure
|
31 |
+
The models are fine-tuned with CodeLlama-Instruct-hf models as base models. Each model is trained for 3 epochs, and the best checkpoint is selected.
|
32 |
+
|
33 |
+
## Evaluation
|
34 |
+
Reference our project page for evaluation results on 7B-M
|
35 |
+
|
36 |
+
## Usage
|
37 |
+
You can use the models through Huggingface's Transformers library.
|
38 |
+
Check our Github repo for the evaluation code: [https://github.com/TIGER-AI-Lab/StructLM](https://github.com/TIGER-AI-Lab/StructLM)
|
39 |
+
|
40 |
+
|
41 |
+
## Prompt Format
|
42 |
+
|
43 |
+
**For this 7B model, the prompt format is**
|
44 |
+
```
|
45 |
+
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
46 |
+
|
47 |
+
|
48 |
+
### Instruction:
|
49 |
+
{instruction}
|
50 |
+
|
51 |
+
{input}
|
52 |
+
|
53 |
+
{question}
|
54 |
+
|
55 |
+
### Response:
|
56 |
+
|
57 |
+
```
|
58 |
+
|
59 |
+
To see concrete examples of this linearization, you can directly reference the 🤗 [SKGInstruct Dataset](https://huggingface.co/datasets/TIGER-Lab/SKGInstruct) (coming soon).
|
60 |
+
We will provide code for linearizing this data shortly.
|
61 |
+
|
62 |
+
|
63 |
+
A few examples:
|
64 |
+
|
65 |
+
**Tabular data**
|
66 |
+
```
|
67 |
+
col : day | kilometers row 1 : tuesday | 0 row 2 : wednesday | 0 row 3 : thursday | 4 row 4 : friday | 0 row 5 : saturday | 0
|
68 |
+
```
|
69 |
+
|
70 |
+
**Knowledge triples (dart)**
|
71 |
+
```
|
72 |
+
Hawaii Five-O : notes : Episode: The Flight of the Jewels | [TABLECONTEXT] : [title] : Jeff Daniels | [TABLECONTEXT] : title : Hawaii Five-O
|
73 |
+
```
|
74 |
+
|
75 |
+
**Knowledge graph schema (grailqa)**
|
76 |
+
```
|
77 |
+
top antiquark: m.094nrqp | physics.particle_antiparticle.self_antiparticle physics.particle_family physics.particle.antiparticle physics.particle_family.subclasses physics.subatomic_particle_generation physics.particle_family.particles physics.particle common.image.appears_in_topic_gallery physics.subatomic_particle_generation.particles physics.particle.family physics.particle_family.parent_class physics.particle_antiparticle physics.particle_antiparticle.particle physics.particle.generation
|
78 |
+
```
|
79 |
+
|
80 |
+
**Example input**
|
81 |
+
|
82 |
+
```
|
83 |
+
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
84 |
+
|
85 |
+
|
86 |
+
### Instruction:
|
87 |
+
Use the information in the following table to solve the problem, choose between the choices if they are provided. table:
|
88 |
+
|
89 |
+
col : day | kilometers row 1 : tuesday | 0 row 2 : wednesday | 0 row 3 : thursday | 4 row 4 : friday | 0 row 5 : saturday | 0
|
90 |
+
|
91 |
+
question:
|
92 |
+
|
93 |
+
Allie kept track of how many kilometers she walked during the past 5 days. What is the range of the numbers? [/INST]
|
94 |
+
|
95 |
+
### Response:
|
96 |
+
|
97 |
+
```
|
98 |
+
|
99 |
+
|
100 |
+
## Intended Uses
|
101 |
+
These models are trained for research purposes. They are designed to be proficient in interpreting linearized structured input. Downstream uses can potentially include various applications requiring the interpretation of structured data.
|
102 |
+
|
103 |
+
## Limitations
|
104 |
+
While we've tried to build an SKG-specialized model capable of generalizing, we have shown that this is a challenging domain, and it may lack performance characteristics that allow it to be directly used in chat or other applications.
|
105 |
+
|
106 |
+
|
107 |
+
## Citation
|
108 |
+
If you use the models, data, or code from this project, please cite the original paper:
|
109 |
+
|
110 |
+
```
|
111 |
+
@misc{zhuang2024structlm,
|
112 |
+
title={StructLM: Towards Building Generalist Models for Structured Knowledge Grounding},
|
113 |
+
author={Alex Zhuang and Ge Zhang and Tianyu Zheng and Xinrun Du and Junjie Wang and Weiming Ren and Stephen W. Huang and Jie Fu and Xiang Yue and Wenhu Chen},
|
114 |
+
year={2024},
|
115 |
+
eprint={2402.16671},
|
116 |
+
archivePrefix={arXiv},
|
117 |
+
primaryClass={cs.CL}
|
118 |
+
}
|
119 |
+
```
|