facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.49k stars 2.1k forks source link

Controlling conversational behaviour - Blender 90M finetuned #3906

Closed anelkhvan closed 3 years ago

anelkhvan commented 3 years ago

Hello! I finetuned the original Blender 90M further, with greatest weight given to the ConvAI2 dataset: `from parlai.scripts.train_model import TrainModel TrainModel.main(

similar to before

multitask_weights = [2, 6, 3, 3],
task='blended_skill_talk,convai2:normalized,empathetic_dialogues, wizard_of_wikipedia', 
#model='transformer/generator',
model_file='XXXXX',

# initialize with a pretrained model
#init_model='zoo:tutorial_transformer_generator/model',
#init_model='finetuned/model',

# arguments we get from the pretrained model.
# Unfortunately, these must be looked up separately for each model.
n_heads=16, n_layers=8, n_positions=512, text_truncate=512,
label_truncate=128, ffn_size=2048, embedding_size=512,
activation='gelu', variant='xlm',
dict_lower=True, dict_tokenizer='bpe',
#dict_file='zoo:tutorial_transformer_generator/model.dict',
#dict_file = 'finetuned/model.dict',
learn_positional_embeddings=True,

# some training arguments, specific to this fine-tuning
# use a small learning rate with ADAM optimizer
lr=1e-5, optimizer='adam',
warmup_updates=-1,
# early stopping on perplexity
validation_metric='ppl',
# train at most steps, and validate every 0.25 epochs
eps=9, validation_every_n_epochs=0.25,

batchsize=8, fp16=True, fp16_impl='mem_efficient',

# speeds up validation
skip_generation=True,

# helps us cram more examples into our gpu at a time
dynamic_batching='full',

)` I noticed that after 6-7 conversational turns, this model tries to finish the conversation by saying: "Thank you! Have a great day!". Are there any arguments that I can specify to make the model talk for longer and not finish the conversation early?

stephenroller commented 3 years ago

Controllability of these models remains an open research question. For now, the easiest recommendation I have is to just filter the convai2 data to remove turns like "have a great day".

See also the recent paper on Personal Knowledge for other options for improvement.

anelkhvan commented 3 years ago

Thanks a lot!!

github-actions[bot] commented 3 years ago

This issue has not had activity in 30 days. Please feel free to reopen if you have more issues. You may apply the "never-stale" tag to prevent this from happening.