表格分类微调 (TabLLM)
Ludwig 中的提示模板使用 Python 风格的占位符标记,每个占位符对应于输入数据集中的一个列
prompt:
template: "The {color} {animal} jumped over the {size} {object}"
当提供了如上所示的提示模板时,填充了所有占位符的提示将用作 LLM 的文本输入特征值。
Dataset:
| color | animal | size | object |
| ----- | ------ | ---- | ------ |
| brown | fox | big | dog |
| white | cat | huge | rock |
Prompts:
"The brown fox jumped over the big dog"
"The white cat jumped over the huge rock"
通过使用数据集的列构建提示,可以将表格数据直接用于 LLM 微调设置。
例如,以下配置展示了如何在具有以下列名称的表格数据上使用二元分类头对 BERT 进行微调
最近捐赠间隔 -- 自上次捐赠以来的月数
频率 -- 总捐赠次数
献血量 -- 总献血量 (c.c.)
间隔时间 -- 自首次捐赠以来的月数
配置¶
input_features:
- name: Recency -- months since last donation
type: text
prompt:
template: >-
The Recency -- months since last donation is {Recency -- months since
last donation}. The Frequency -- total number of donations is {Frequency
-- total number of donations}. The Monetary -- total blood donated in
c.c. is {Monetary -- total blood donated in c.c.}. The Time -- months
since first donation is {Time -- months since first donation}.
output_features:
- name: 'y'
type: binary
column: 'y'
preprocessing:
split:
type: fixed
column: split
defaults:
text:
encoder:
type: bert
trainable: true
combiner:
type: concat
trainer:
epochs: 50
optimizer:
type: adamw
learning_rate: 0.00002
use_mixed_precision: true
learning_rate_scheduler:
decay: linear
warmup_fraction: 0.1
ludwig_version: 0.8.dev