Although the synthesis of programs encoding policies often carries the promise of interpretability, systematic evaluations were never performed to assess the interpretability of these policies, likely because of the complexity of such an evaluation. In this paper, we introduce a novel metric that uses large-language models (LLM) to assess the interpretability of programmatic policies. For our metric, an LLM is given both a program and a description of its associated programming language. The LLM then formulates a natural language explanation of the program. This explanation is subsequently fed into a second LLM, which tries to reconstruct the program from the natural-language explanation. Our metric then measures the behavioral similarity between the reconstructed program and the original. We validate our approach with synthesized and human-crafted programmatic policies for playing a real-time strategy game, comparing the interpretability scores of these programmatic policies to obfuscated versions of the same programs. Our LLM-based interpretability score consistently ranks less interpretable programs lower and more interpretable ones higher. These findings suggest that our metric could serve as a reliable and inexpensive tool for evaluating the interpretability of programmatic policies.
翻译:尽管编码策略的程序合成通常被认为具有可解释性,但此前从未有系统性评估验证这些策略的可解释性,这很可能是因为此类评估的复杂性。本文提出了一种利用大语言模型(LLM)评估程序化策略可解释性的新指标。在该指标中,我们向LLM同时提供一个程序及其关联编程语言的描述,要求其生成该程序的自然语言解释。随后,该解释被输入第二个LLM,由其从自然语言解释中重构原始程序。最终,我们的指标通过测量重构程序与原始程序之间的行为相似性来量化可解释性。我们通过合成及人工编写的实时策略游戏程序化策略对该方法进行验证,并将这些策略的可解释性评分与其混淆版本进行对比。基于LLM的可解释性评分始终如一地将低可解释性程序排至末位,而将高可解释性程序置于前列。研究结果表明,我们的指标可作为一种可靠且成本低廉的工具,用于评估程序化策略的可解释性。