Code Compliance Assessment as a Learning Problem
- URL: http://arxiv.org/abs/2209.04602v1
- Date: Sat, 10 Sep 2022 05:41:04 GMT
- Title: Code Compliance Assessment as a Learning Problem
- Abstract summary: We formulate code compliance assessment as a machine learning (ML) problem.
We generate a prediction on the code's compliance, non-compliance, or irrelevance.
Our tool Policy2Code achieves classification accuracies of (59%, 71%) and search MRR of (0.05, 0.21)
In a user study, 24% Policy2Code detections were accepted compared to 7% for CodeBERT.
- Score: 0.15229257192293197
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Manual code reviews and static code analyzers are the traditional mechanisms
to verify if source code complies with coding policies. However, these
mechanisms are hard to scale. We formulate code compliance assessment as a
machine learning (ML) problem, to take as input a natural language policy and
code, and generate a prediction on the code's compliance, non-compliance, or
irrelevance. This can help scale compliance classification and search for
policies not covered by traditional mechanisms. We explore key research
questions on ML model formulation, training data, and evaluation setup. The
core idea is to obtain a joint code-text embedding space which preserves
compliance relationships via the vector distance of code and policy embeddings.
As there is no task-specific data, we re-interpret and filter commonly
available software datasets with additional pre-training and pre-finetuning
tasks that reduce the semantic gap. We benchmarked our approach on two listings
of coding policies (CWE and CBP). This is a zero-shot evaluation as none of the
policies occur in the training set. On CWE and CBP respectively, our tool
Policy2Code achieves classification accuracies of (59%, 71%) and search MRR of
(0.05, 0.21) compared to CodeBERT with classification accuracies of (37%, 54%)
and MRR of (0.02, 0.02). In a user study, 24% Policy2Code detections were
accepted compared to 7% for CodeBERT.
Related papers
- Graph-Constrained Policy Learning for Extreme Clinical Code Prediction [1.116791976498254]
Clinical code prediction maps unstructured discharge summaries to ICD-10-CM leaf codes in a large, sparse, and deeply hierarchical label space.<n>Most systems treat the task as flat multi-label classification, scoring codes independently and providing limited training signal for rare labels.<n>We propose a graph-constrained policy that formulates ICD prediction as a finite-horizon decision process over a pruned code hierarchy.
arXiv Detail & Related papers (2026-07-11T23:10:01Z) - When Better Codebooks Are Not Enough: Predictive Performance and Behavioral Reliability in LLM Political Event Coding [1.0312121265468142]
Many social-science studies rely on expert-written codebooks to turn text into structured data.<n>We study this problem in political event coding, a challenging source-target relation classification task.<n>We test whether expert codebooks become more effective when operationalized into LLM-friendly forms with clearer definitions.
arXiv Detail & Related papers (2026-06-04T23:51:14Z) - Can Generalist Agents Automate Data Curation? [58.652262227632406]
Curating training data is among the most consequential yet labor-intensive parts of modern AI development.<n>We ask whether generalist coding agents can automate this data-curation loop.<n>We introduce *Curation-Bench*, an agent-centric benchmark that fixes the model, training recipe, and evaluation suite.
arXiv Detail & Related papers (2026-06-02T22:26:53Z) - Inferring Code Correctness from Specification [0.0]
Large language models (LLMs) have become integral to modern software development, enabling automated code generation at scale.<n>We propose TRAILS (Targeted Reasoning Agreement via Inputs and Specifications), an approach that grounds LLM reasoning with concrete (input, output) pairs.<n>We evaluate TRAILS on two datasets, LiveCodeBench and CoCoClaNeL, across three LLMs (Qwen3Coder-30B, Devstral-Small-24B, and Olmo3.1-Instruct), comparing against HoarePrompt and a Zero-Shot Chain-of-Thought baseline.
arXiv Detail & Related papers (2026-05-28T12:04:51Z) - Trust the Batch, On- or Off-Policy: Adaptive Policy Optimization for RL Post-Training [50.86545293331458]
Reinforcement learning is structurally harder than supervised learning because the policy changes the data distribution it learns from.<n>We present a simple yet effective batch-adaptive objective that replaces fixed clipping with the normalized effective sample size of the policy ratios.
arXiv Detail & Related papers (2026-05-12T16:44:47Z) - Whitespaces Don't Lie: Feature-Driven and Embedding-Based Approaches for Detecting Machine-Generated Code [0.2624902795082451]
Large language models (LLMs) have made it remarkably easy to synthesize plausible source code from natural language prompts.<n>This paper investigates the problem of distinguishing human-written from machine-generated code by comparing two complementary approaches.
arXiv Detail & Related papers (2026-01-27T06:43:51Z) - SciCoQA: Quality Assurance for Scientific Paper--Code Alignment [53.70401063640645]
We present SciCoQA, a dataset for detecting discrepancies between scientific publications and theirs.<n>Our dataset consists of 611 paper-code discrepancies (81 real, 530 synthetic), spanning diverse computational science disciplines.<n>The best performing model in our evaluation, GPT-5, can only detect 45.7% of real-world paper-code discrepancies.
arXiv Detail & Related papers (2026-01-19T10:04:33Z) - AXIOM: Benchmarking LLM-as-a-Judge for Code via Rule-Based Perturbation and Multisource Quality Calibration [28.117814524373667]
AXIOM is a novel perturbation-based framework for synthesizing code evaluation benchmarks at scale.<n>It reframes program scores as the refinement effort needed for deployment.
arXiv Detail & Related papers (2025-12-23T08:39:22Z) - CPRet: A Dataset, Benchmark, and Model for Retrieval in Competitive Programming [56.17331530444765]
CPRet is a retrieval-oriented benchmark suite for competitive programming.<n>It covers four retrieval tasks: two code-centric (i.e., Text-to-Code and Code-to-Code) and two newly proposed problem-centric tasks (i.e., Problem-to-Duplicate and Simplified-to-Full)<n>Our contribution includes both high-quality training data and temporally separated test sets for reliable evaluation.
arXiv Detail & Related papers (2025-05-19T10:07:51Z) - Is Compression Really Linear with Code Intelligence? [60.123628177110206]
textitFormat Annealing is a lightweight, transparent training methodology designed to assess the intrinsic capabilities of pre-trained models equitably.<n>Our empirical results reveal a fundamental logarithmic relationship between measured code intelligence and bits-per-character (BPC)<n>Our work provides a more nuanced understanding of compression's role in developing code intelligence and contributes a robust evaluation framework in the code domain.
arXiv Detail & Related papers (2025-05-16T16:59:14Z) - NRevisit: A Cognitive Behavioral Metric for Code Understandability Assessment [1.513554688029813]
This paper proposes a dynamic code understandability assessment method.
It estimates a personalized code understandability score from the perspective of the specific programmer handling the code.
It can be easily implemented using a simple, low-cost, and non-intrusive desktop eye tracker or even a standard computer camera.
arXiv Detail & Related papers (2025-04-25T13:34:24Z) - Rubric Is All You Need: Enhancing LLM-based Code Evaluation With Question-Specific Rubrics [1.3707925738322797]
We focus on LLM-based code evaluation and attempt to fill in the existing gaps.
We propose multi-agentic novel approaches using question-specific rubrics tailored to the problem statement.
Our comprehensive analysis demonstrates that question-specific rubrics significantly enhance logical assessment of code in educational settings.
arXiv Detail & Related papers (2025-03-31T11:59:43Z) - Sifting through the Chaff: On Utilizing Execution Feedback for Ranking the Generated Code Candidates [46.74037090843497]
Large Language Models (LLMs) are transforming the way developers approach programming by automatically generating code based on natural language descriptions.
This paper puts forward RankEF, an innovative approach for code ranking that leverages execution feedback.
Experiments on three code generation benchmarks demonstrate that RankEF significantly outperforms the state-of-the-art CodeRanker.
arXiv Detail & Related papers (2024-08-26T01:48:57Z) - Co-training for Low Resource Scientific Natural Language Inference [65.37685198688538]
We propose a novel co-training method that assigns weights based on the training dynamics of the classifiers to the distantly supervised labels.
By assigning importance weights instead of filtering out examples based on an arbitrary threshold on the predicted confidence, we maximize the usage of automatically labeled data.
The proposed method obtains an improvement of 1.5% in Macro F1 over the distant supervision baseline, and substantial improvements over several other strong SSL baselines.
arXiv Detail & Related papers (2024-06-20T18:35:47Z) - Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting [78.48355455324688]
We propose a novel zero-shot synthetic code detector based on the similarity between the original code and its LLM-rewritten variants.
Our results demonstrate a significant improvement over existing SOTA synthetic content detectors.
arXiv Detail & Related papers (2024-05-25T08:57:28Z) - Query Performance Prediction using Relevance Judgments Generated by Large Language Models [53.97064615557883]
We propose a QPP framework using automatically generated relevance judgments (QPP-GenRE)
QPP-GenRE decomposes QPP into independent subtasks of predicting relevance of each item in a ranked list to a given query.
This allows us to predict any IR evaluation measure using the generated relevance judgments as pseudo-labels.
arXiv Detail & Related papers (2024-04-01T09:33:05Z) - Code Revert Prediction with Graph Neural Networks: A Case Study at J.P. Morgan Chase [10.961209762486684]
Code revert prediction aims to forecast or predict the likelihood of code changes being reverted or rolled back in software development.
Previous methods for code defect detection relied on independent features but ignored relationships between code scripts.
This paper presents a systematic empirical study for code revert prediction that integrates the code import graph with code features.
arXiv Detail & Related papers (2024-03-14T15:54:29Z) - Trained Without My Consent: Detecting Code Inclusion In Language Models Trained on Code [13.135962181354465]
Code auditing ensures that developed code adheres to standards, regulations, and copyright protection.
The recent advent of Large Language Models (LLMs) as coding assistants in the software development process poses new challenges for code auditing.
We propose TraWiC; a model-agnostic and interpretable method for detecting code inclusion in an LLM's training dataset.
arXiv Detail & Related papers (2024-02-14T16:41:35Z) - Zero-Shot Detection of Machine-Generated Codes [83.0342513054389]
This work proposes a training-free approach for the detection of LLMs-generated codes.
We find that existing training-based or zero-shot text detectors are ineffective in detecting code.
Our method exhibits robustness against revision attacks and generalizes well to Java codes.
arXiv Detail & Related papers (2023-10-08T10:08:21Z) - CoSQA: 20,000+ Web Queries for Code Search and Question Answering [63.92224685262063]
CoSQA dataset includes 20,604 labels for pairs of natural language queries and codes.
We introduce a contrastive learning method dubbed CoCLR to enhance query-code matching.
We show that evaluated on CodeXGLUE with the same CodeBERT model, training on CoSQA improves the accuracy of code question answering by 5.1%.
arXiv Detail & Related papers (2021-05-27T15:37:21Z) - TransICD: Transformer Based Code-wise Attention Model for Explainable
ICD Coding [5.273190477622007]
International Classification of Disease (ICD) coding procedure has been shown to be effective and crucial to the billing system in medical sector.
Currently, ICD codes are assigned to a clinical note manually which is likely to cause many errors.
In this project, we apply a transformer-based architecture to capture the interdependence among the tokens of a document and then use a code-wise attention mechanism to learn code-specific representations of the entire document.
arXiv Detail & Related papers (2021-03-28T05:34:32Z) - CodeBLEU: a Method for Automatic Evaluation of Code Synthesis [57.87741831987889]
In the area of code synthesis, the commonly used evaluation metric is BLEU or perfect accuracy.
We introduce a new automatic evaluation metric, dubbed CodeBLEU.
It absorbs the strength of BLEU in the n-gram match and further injects code syntax via abstract syntax trees (AST) and code semantics via data-flow.
arXiv Detail & Related papers (2020-09-22T03:10:49Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.