Pith. sign in

REVIEW 4 cited by

Large Language Models for Code: Security Hardening and Adversarial Testing

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2302.05319 v5 pith:PEWVVGBQ submitted 2023-02-10 cs.CR cs.LGcs.PLcs.SE

classification cs.CRcs.LGcs.PLcs.SE
keywords codesecuritysvenadversarialhardeninglargesecuretask
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Large language models (large LMs) are increasingly trained on massive codebases and used to generate code. However, LMs lack awareness of security and are found to frequently produce unsafe code. This work studies the security of LMs along two important axes: (i) security hardening, which aims to enhance LMs' reliability in generating secure code, and (ii) adversarial testing, which seeks to evaluate LMs' security at an adversarial standpoint. We address both of these by formulating a new security task called controlled code generation. The task is parametric and takes as input a binary property to guide the LM to generate secure or unsafe code, while preserving the LM's capability of generating functionally correct code. We propose a novel learning-based approach called SVEN to solve this task. SVEN leverages property-specific continuous vectors to guide program generation towards the given property, without modifying the LM's weights. Our training procedure optimizes these continuous vectors by enforcing specialized loss terms on different regions of code, using a high-quality dataset carefully curated by us. Our extensive evaluation shows that SVEN is highly effective in achieving strong security control. For instance, a state-of-the-art CodeGen LM with 2.7B parameters generates secure code for 59.1% of the time. When we employ SVEN to perform security hardening (or adversarial testing) on this LM, the ratio is significantly boosted to 92.3% (or degraded to 36.8%). Importantly, SVEN closely matches the original LMs in functional correctness.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Training Language Models to Generate Quality Code with Program Analysis Feedback

    cs.CL 2025-05 conditional novelty 7.0 of 10

    REAL trains LLMs with rewards from program analysis and unit tests, improving joint functionality and code quality over prior methods.

  2. Closing the Gap: A User Study on the Real-world Usefulness of AI-powered Vulnerability Detection & Repair in the IDE

    cs.SE 2024-12 conditional novelty 7.0 of 10

    A user study of 17 developers using an IDE-integrated AI vulnerability scanner on their own projects found high false-positive rates and non-applicable fixes, making the tool not yet practical.

  3. Activation Probes Surface Code-Security Signals that the Model's Output Misses

    cs.CR 2026-08 conditional novelty 6.0 of 10

    A linear probe read from open-weight LLM activations ranks vulnerable Python functions above their fixes on 61-67% of unseen CVEs, outperforming the same models' prompted verdicts.

  4. Emerging Security Challenges of Large Language Models

    cs.CR 2024-12 unverdicted

    A workshop report summarizes adversarial attack surfaces of LLMs, from training data poisoning to prompt injection, and calls for more research on defenses.

Pith tools