kth.sePublications KTH
Change search
Link to record
Permanent link

Direct link
Shan, Junjie
Publications (3 of 3) Show all publications
Dou, S., Liu, Y., Jia, H., Zhou, E., Xiong, L., Shan, J., . . . Huang, X. (2024). StepCoder: Improving Code Generation with Reinforcement Learning from Compiler Feedback. In: 62nd Annual Meeting of the Association for Computational Linguistics, ACL 2024 - Proceedings of the Conference: . Paper presented at 62nd Annual Meeting of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand, Aug 11 2024 - Aug 16 2024 (pp. 4571-4585). Association for Computational Linguistics (ACL)
Open this publication in new window or tab >>StepCoder: Improving Code Generation with Reinforcement Learning from Compiler Feedback
Show others...
2024 (English)In: 62nd Annual Meeting of the Association for Computational Linguistics, ACL 2024 - Proceedings of the Conference, Association for Computational Linguistics (ACL) , 2024, p. 4571-4585Conference paper, Published paper (Refereed)
Abstract [en]

The advancement of large language models (LLMs) has significantly propelled the field of code generation. Previous work integrated reinforcement learning (RL) with compiler feedback for exploring the output space of LLMs to enhance code generation quality. However, the lengthy code generated by LLMs in response to complex human requirements makes RL exploration a challenge. Also, since the unit tests may not cover the complicated code, optimizing LLMs by using these unexecuted code snippets is ineffective. To tackle these challenges, we introduce StepCoder, a novel RL framework for code generation, consisting of two main components: CCCS addresses the exploration challenge by breaking the long sequences code generation task into a Curriculum of Code Completion Subtasks, while FGO only optimizes the model by masking the unexecuted code segments to provide Fine-Grained Optimization. In addition, we furthermore construct the APPS+ dataset for RL training, which is manually verified to ensure the correctness of unit tests. Experimental results show that our method improves the ability to explore the output space and outperforms state-of-the-art approaches in corresponding benchmarks.

Place, publisher, year, edition, pages
Association for Computational Linguistics (ACL), 2024
National Category
Software Engineering
Identifiers
urn:nbn:se:kth:diva-354306 (URN)10.18653/v1/2024.acl-long.251 (DOI)2-s2.0-85204445491 (Scopus ID)
Conference
62nd Annual Meeting of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand, Aug 11 2024 - Aug 16 2024
Note

QC 20241003

Part of ISBN 9798891760943

Available from: 2024-10-02 Created: 2024-10-02 Last updated: 2025-05-27Bibliographically approved
Dou, S., Zheng, R., Wu, T., Gao, S., Shan, J., Zhang, Q., . . . Huang, X. (2022). Decorrelate Irrelevant, Purify Relevant: Overcome Textual Spurious Correlations from a Feature Perspective. In: : . Paper presented at 29th International Conference on Computational Linguistics, COLING 2022, Gyeongju, Korea, Oct 12 2022 - Oct 17 2022 (pp. 2278-2287). Association for Computational Linguistics (ACL)
Open this publication in new window or tab >>Decorrelate Irrelevant, Purify Relevant: Overcome Textual Spurious Correlations from a Feature Perspective
Show others...
2022 (English)Conference paper, Published paper (Refereed)
Abstract [en]

Natural language understanding (NLU) models tend to rely on spurious correlations (i.e., dataset bias) to achieve high performance on in-distribution datasets but poor performance on out-of-distribution ones. Most of the existing debiasing methods often identify and weaken these samples with biased features (i.e., superficial surface features that cause such spurious correlations). However, down-weighting these samples obstructs the model in learning from the non-biased parts of these samples. To tackle this challenge, in this paper, we propose to eliminate spurious correlations in a fine-grained manner from a feature space perspective. Specifically, we introduce Random Fourier Features and weighted re-sampling to decorrelate the dependencies between features to mitigate spurious correlations. After obtaining decorrelated features, we further design a mutual-information-based method to purify them, which forces the model to learn features that are more relevant to tasks. Extensive experiments on two well-studied NLU tasks demonstrate that our method is superior to other comparative approaches.

Place, publisher, year, edition, pages
Association for Computational Linguistics (ACL), 2022
National Category
Computer Sciences Computer graphics and computer vision
Identifiers
urn:nbn:se:kth:diva-334544 (URN)2-s2.0-85162802051 (Scopus ID)
Conference
29th International Conference on Computational Linguistics, COLING 2022, Gyeongju, Korea, Oct 12 2022 - Oct 17 2022
Note

QC 20230822

Available from: 2023-08-22 Created: 2023-08-22 Last updated: 2025-02-01Bibliographically approved
Hu, Y., Zou, D., Peng, J., Wu, Y., Shan, J. & Jin, H. (2022). TreeCen: Building Tree Graph for Scalable Semantic Code Clone Detection. In: iWOAR 2022: 7th International Workshop on Sensor-Based Activity Recognition and Artificial Intelligence, Proceedings. Paper presented at 7th International Workshop on Sensor-Based Activity Recognition and Artificial Intelligence, iWOAR 2022, Rostock, Germany, Sep 19 2022 - Sep 20 2022. Association for Computing Machinery (ACM), Article ID 109.
Open this publication in new window or tab >>TreeCen: Building Tree Graph for Scalable Semantic Code Clone Detection
Show others...
2022 (English)In: iWOAR 2022: 7th International Workshop on Sensor-Based Activity Recognition and Artificial Intelligence, Proceedings, Association for Computing Machinery (ACM) , 2022, article id 109Conference paper, Published paper (Refereed)
Abstract [en]

Code clone detection is an important research problem that has attracted wide attention in software engineering. Many methods have been proposed for detecting code clone, among which text-based and token-based approaches are scalable but lack consideration of code semantics, thus resulting in the inability to detect semantic code clones. Methods based on intermediate representations of codes can solve the problem of semantic code clone detection. However, graph-based methods are not practicable due to code compilation, and existing tree-based approaches are limited by the scale of trees for scalable code clone detection. In this paper, we propose TreeCen, a scalable tree-based code clone detector, which satisfies scalability while detecting semantic clones effectively. Given the source code of a method, we first extract its abstract syntax tree (AST) based on static analysis and transform it into a simple graph representation (i.e., tree graph) according to the node type, rather than using traditional heavyweight tree matching. We then treat the tree graph as a social network and adopt centrality analysis on each node to maintain the tree details. By this, the original complex tree can be converted into a 72-dimensional vector while containing comprehensive structural information of the AST. Finally, these vectors are fed into a machine learning model to train a detector and use it to find code clones. We conduct comparative evaluations on effectiveness and scalability. The experimental results show that TreeCen maintains the best performance of the other six state-of-the-art methods (i.e., SourcererCC, RtvNN, DeepSim, SCDetector, Deckard, and ASTNN) with F1 scores of 0.99 and 0.95 on BigCloneBench and Google Code Jam datasets, respectively. In terms of scalability, TreeCen is about 79 times faster than the other state-of-the-art tree-based semantic code clone detector (ASTNN), about 13 times faster than the fastest graph-based approach (SCDetector), and even about 22 times faster than the one-time trained token-based detector (RtvNN).

Place, publisher, year, edition, pages
Association for Computing Machinery (ACM), 2022
National Category
Computer Sciences Software Engineering
Identifiers
urn:nbn:se:kth:diva-333430 (URN)10.1145/3551349.3556927 (DOI)001062775200035 ()36259288 (PubMedID)2-s2.0-85146924679 (Scopus ID)
Conference
7th International Workshop on Sensor-Based Activity Recognition and Artificial Intelligence, iWOAR 2022, Rostock, Germany, Sep 19 2022 - Sep 20 2022
Note

Part of ISBN 9781450396240

QC 20230801

Available from: 2023-08-01 Created: 2023-08-01 Last updated: 2023-10-25Bibliographically approved
Organisations

Search in DiVA

Show all publications