Large Language Models (LLMs) have become increasingly popular for coding tasks, with subjective coding preferences being an essential element to adapt to programmers' personal needs. Existing work overlooks such characteristics and mainly focuses on code correctness. In this study, we propose a typification of four subjective coding preference axes - complexity, commenting, modularity, and readability - motivated by common engineering habits and validated by 25 software engineers. We collect a dataset of ~3,000 paired Python code snippets reflecting these axes, annotated by 73 experts who rate their preferences on a Likert scale. Using our dataset, we study how LLMs handle subjective coding preferences. We present 13 LLMs with pairs of solutions to the same programming task, first as textual descriptions and then as concrete code snippets. We find that models often prefer one option in natural language but the opposite when evaluating code. More consistent models (i.e., those that are coherent in their choices between deeds and words) frequently reveal positional bias: swapping the order of options changes the preferred alternative. We then use the five most consistent models to re-annotate the dataset. Compared to humans, models show polarized Likert distributions and notable divergence in ratings. A case study on GPT-5 reveals reliance on external assumptions and brittle reasoning.


翻译:大型语言模型(LLMs)在编程任务中日益流行,而主观代码偏好是适应程序员个人需求的关键要素。现有研究忽视了这一特性,主要聚焦于代码正确性。在本研究中,我们基于常见工程习惯,提出了一种包含四个主观代码偏好维度的类型学框架——复杂性、注释性、模块化和可读性——该框架经25名软件工程师验证。我们收集了约3000对反映这些维度的Python代码片段数据集,由73名专家采用李克特量表对偏好进行标注。利用该数据集,我们研究了LLMs如何处理主观代码偏好。我们向13个LLM呈现同一编程任务的成对解决方案,首先以文本描述形式,随后以具体代码片段形式。结果发现,模型在自然语言中常偏好某一选项,但在评估代码时却选择相反选项。更一致的模型(即在行为与语言选择上保持连贯的模型)频繁表现出位置偏差:选项顺序的交换会改变其偏好选择。随后,我们使用五个最一致的模型对数据集进行重新标注。与人类相比,模型显示出极化的李克特分布,并在评分上存在显著分歧。针对GPT-5的案例研究表明,其依赖外部假设且推理脆弱。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
稀疏自编码器综述:解释大语言模型的内部机制
专知会员服务
17+阅读 · 2025年12月27日
大型语言模型中隐性与显性偏见的综合研究
专知会员服务
17+阅读 · 2025年11月25日
面向统计学家的大型语言模型概述
专知会员服务
32+阅读 · 2025年3月16日
迈向大语言模型偏好学习的统一视角综述
专知会员服务
24+阅读 · 2024年9月7日
大规模语言模型的人类偏好学习综述
专知会员服务
42+阅读 · 2024年6月19日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
【博士论文】语言模型与人类偏好对齐,148页pdf
专知会员服务
32+阅读 · 2024年4月21日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
推荐|机器学习中的模型评价、模型选择和算法选择!
全球人工智能
10+阅读 · 2018年2月5日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
稀疏自编码器综述:解释大语言模型的内部机制
专知会员服务
17+阅读 · 2025年12月27日
大型语言模型中隐性与显性偏见的综合研究
专知会员服务
17+阅读 · 2025年11月25日
面向统计学家的大型语言模型概述
专知会员服务
32+阅读 · 2025年3月16日
迈向大语言模型偏好学习的统一视角综述
专知会员服务
24+阅读 · 2024年9月7日
大规模语言模型的人类偏好学习综述
专知会员服务
42+阅读 · 2024年6月19日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
【博士论文】语言模型与人类偏好对齐,148页pdf
专知会员服务
32+阅读 · 2024年4月21日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员