Open SXxinxiaosong opened 2 weeks ago
Thank you for your interest in EasyEdit. We will reproduce this result and resolve the issue in the near future.
您好,我又实验了一次,'post': {'rewrite_acc'} 仍然是保持在0.38左右。
同时,在查看代码过程中,发现GRACE的evaluate function中test_prediction_acc(model, tok, hparams, prompt, target_new, device, vanilla_generation=True) vanilla_generation设置为True。其他方法是基于target_new输出,GRACE使用model.generate()输出。将vanilla_generation改为False之后,GRACE的结果是:
Metrics Summary: {'pre': {'rewrite_acc': 0.37488205598313207, 'rephrase_acc': 0.37201854107119287, 'portability': {'one_hop_acc': 0.4772354551500425}}, 'post': {'rewrite_acc': 0.39502925654924115, 'rephrase_acc': 0.37201854107119287, 'locality': {'Relation_Specificity_acc': 1.0}, 'portability': {'one_hop_acc': 0.4772354551500425}}}
rewrite_acc保持在0.39左右,但是rephrase_acc显著提高了。
请问GRACE单独将vanilla_generation设置为Ture的原因是什么呢?
vanilla_generation设置为Ture是因为GRACE使用了一个adapter,调用model.generate()会将key_id 设置为-1 ,以确保token_to_edit 能被正确设置。
Hi, do you have any further questions?
嗯嗯 第一个复现问题还没有解决,请先不要关闭~
vanilla_generation设置为Ture是因为GRACE使用了一个adapter,调用model.generate()会将key_id 设置为-1 ,以确保token_to_edit 能被正确设置。
def compute_portability_quality(
model,
model_name,
hparams: HyperParams,
tok: AutoTokenizer,
portability_key: str,
prompt: typing.Union[str, List[str]],
ground_truth: typing.Union[str, List[str]],
device,
) -> typing.Dict:
if 't5' in model_name.lower():
portability_correct = test_seq2seq_batch_prediction_acc(model, tok, hparams, prompt, ground_truth, device)
else:
portability_correct = test_prediction_acc(model, tok, hparams, prompt, ground_truth, device)
ret = {
f"{portability_key}_acc": portability_correct
}
return ret
请问计算portability时,为什么没有将GRACE单独处理呢?
It‘s a bug here and we would fix it.
I have fixed it
可以reopen一下吗,复现的GRACE的sequential edit的结果和论文有较大出入~
在我的实验环境中,能够轻松复现Grace的结果。
如果你始终无法复现实验结果或对方法本身有更深刻的问题,我建议你联系GRACE原作者。
Hello, I am now playing with GRACE on llama2 recently but I've noticed a significant difference in the results between the default settings and the WISE paper's result. Could you please help me check the issue? Thank you very much!
hparams:
code:
result:
Metrics Summary: {'pre': {'rewrite_acc': 0.002814684674792284, 'rephrase_acc': 0.003032677033445673}, 'post': {'rewrite_acc': 0.3871004187971905, 'rephrase_acc': 0.005825400579435937}}