Worse performance in Text Generation on Chinese corpus

#35
by WQW - opened

problem

I've tested the Bloomz on Chinese language for text generation, while the performance of bloomz became worse:

  • Dataset: nearly 100+ samples
  • Bloomz shows worse results than Bloom with 20+ gap.

That's quite confusing ... Any ideas ?

Sample

input:

"你是一名懂得营销的房产经纪人,请根据下面这套房源的基础信息写一段朋友圈引导文案,要求多使用短文本和emoji,多行排列展示,字数控制在30个字以内,突出小区名称、包含这套房源的亮点,吸引顾客的眼球。房源情况如下:"

bloom:

【融侨锦江玖里,3室2厅,108.42平,115.00万!🤩
🔥低楼层,南北朝向,毛坯,权满两年!
🔥动线分明,动静分区,南北通透!
🔥卧室带卫、阳台,厅带阳台,双卫生间!
🔥明卫、明厨,福清商圈,等你来定制!🤩

bloomz:

【融侨锦江玖里】🏠
3室2厅🛌
108.42平📐
115.00万💰
低楼层📍
南北朝向🔆
毛坯🚪
权满两年📆
动线分明🔹
动静分区🔸
南北通透🌤
卧室带卫🚿
卧室带阳台☀️
厅带阳台🌤
双卫生间🚽
明卫🚽
明厨🍳
福清商圈🛍
抢先看!3室2厅,108.42平,115.00万,低楼层,南北朝向,权满两年,动线分明,动静分区,南北通透,卧室带卫,卧室带阳台,厅带阳台,双卫生间,明卫,明厨,福清商圈,抢先看!

Code

code:

MODEL_PATH = "./saved_bloomz_model"
g_config = GenerationConfig(max_new_tokens=512)
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
model = AutoModelForCausalLM.from_pretrained(MODEL_PATH, device_map="auto", torch_dtype="auto")


def generate(t):
    inputs = tokenizer.encode(t, return_tensors="pt").to("cuda")
    output = model.generate(inputs, generation_config=g_config)
    return tokenizer.decode(output[0]).replace(t, "").replace(tokenizer.eos_token, "")

def get_house_state(text):
    return generate(text)

text = "你是一名懂得营销的房产经纪人,请根据下面这套房源的基础信息写一段朋友圈引导文案,要求多使用短文本和emoji,多行排列展示,字数控制在30个字以内,突出小区名称、包含这套房源的亮点,吸引顾客的眼球。房源情况如下:房源是和辉花园、属于鼓楼杨桥西路商圈、4室2厅、128.80平、278.40万、高楼层、东南朝向、简装、此房产权满五年、动线优秀、卧室带卫、卧室带阳台、卧室朝南、双卫生间、拐角通风、明厨。"

prd_label = get_house_state(text)
print(prd_label)
BigScience Workshop org
BigScience Workshop org

I think you might need to add a trailing space after your input. I think it might be linked to how the model was finetuned

BigScience Workshop org

It might help making it clearer to the model to start its prediction, e.g.
"你是一名懂得营销的房产经纪人,请根据下面这套房源的基础信息写一段朋友圈引导文案,要求多使用短文本和emoji,多行排列展示,字数控制在30个字以内,突出小区名称、包含这套房源的亮点,吸引顾客的眼球。房源情况如下:房源是和辉花园、属于鼓楼杨桥西路商圈、4室2厅、128.80平、278.40万、高楼层、东南朝向、简装、此房产权满五年、动线优秀、卧室带卫、卧室带阳台、卧室朝南、双卫生间、拐角通风、明厨。文案:"

What do you use the "nearly 100+ samples" for? Do you finetune bloomz or do you provide them as fewshot prompts?

Sign up or log in to comment