Goto

Collaborating Authors

 sven


Constrained Decoding for Secure Code Generation

Fu, Yanjun, Baker, Ethan, Ding, Yu, Chen, Yizheng

arXiv.org Artificial Intelligence

Code Large Language Models (Code LLMs) have been increasingly used by developers to boost productivity, but they often generate vulnerable code. Thus, there is an urgent need to ensure that code generated by Code LLMs is correct and secure. Previous research has primarily focused on generating secure code, overlooking the fact that secure code also needs to be correct. This oversight can lead to a false sense of security. Currently, the community lacks a method to measure actual progress in this area, and we need solutions that address both security and correctness of code generation. This paper introduces a new benchmark, CodeGuard+, along with two new metrics, to measure Code LLMs' ability to generate both secure and correct code. Using our new evaluation methods, we show that the state-of-the-art defense technique, prefix tuning, may not be as strong as previously believed, since it generates secure code but sacrifices functional correctness. We also demonstrate that different decoding methods significantly affect the security of Code LLMs. Furthermore, we explore a new defense direction: constrained decoding for secure code generation. We propose new constrained decoding techniques to generate secure code. Our results reveal that constrained decoding is more effective than prefix tuning to improve the security of Code LLMs, without requiring a specialized training dataset. Moreover, our evaluations over eight state-of-the-art Code LLMs show that constrained decoding has strong performance to improve the security of Code LLMs, and our technique outperforms GPT-4.


Large Language Models for Code: Security Hardening and Adversarial Testing

He, Jingxuan, Vechev, Martin

arXiv.org Artificial Intelligence

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.


Drone saves the life of man, 71, suffering a heart attack by delivering defibrillator to his home

Daily Mail - Science & tech

A 71-year-old Swedish man who suffered a heart attack while shoveling snow in his driveway was saved by an unlikely hero - a delivery drone. Sven, a retiree who asked for his last name to be withheld, collapsed outside his home in the western town of Trollhättan in early December. Within moments of receiving the call from Sven's wife, emergency services dispatched the unmanned aerial vehicle carrying an AED, or automated external defibrillator, which arrived in less than four minutes. The system, called Emergency Medical Aerial Delivery (EMADE), was developed by Everdrones to assist patients within 10 minutes of experiencing cardiac arrest. 'Everything from the first 112 call to the drone getting the signal to start and go took about 15-30 seconds and then the whole process took about three and a half minutes,' Sven told AFP.


Artificial Intelligence: The Revolution for SMEs - A Business Knowledge Network Event

#artificialintelligence

AI - 'artificial intelligence' - promises to bring revolution to many parts of our lives: Smart assistants, fully robotic workplaces, driverless cars, "fake news" propaganda. As the digital world around us becomes smarter, what are the implications socially & economically? And what does the future really hold for us in a world of AI? This interesting and informative talk is delivered by Sven Latham from Noggin. Sven is a self-confessed data and computer geek, using big data & AI to analyse town centres.


The Second Season For 'Voltron Legendary Defender' Is Now Finally Out

Forbes - Tech

In case you missed it, the second season of the Netflix exclusive Voltron Legendary Defender was released recently and it's really rather good. Essentially, Voltron Legendary Defender is a reboot of the classic Voltron cartoon from the 80's. That in turn was comprised of two disparate super robot anime series called Beast King GoLion and Armored Fleet Dairugger XV. The former series, GoLion, is what many regard to be Voltron in terms of the mecha as well as the story and Legendary Defender builds on that. To the extent that when I interviewed Joaquim Dos Santos, one of the showrunners for Legendary Defender, last year he was quite upfront about GoLion's influence: We definitely had the benefit of being able to go back and watch the original Beast King GoLion while researching for this show.


A Reduction of the Elastic Net to Support Vector Machines with an Application to GPU Computing

Zhou, Quan (Tsinghua University) | Chen, Wenlin (Washington University in St. Louis) | Song, Shiji (Tsinghua University) | Gardner, Jacob R. (Washington University in St. Louis) | Weinberger, Kilian Q. (Washington University in St. Louis) | Chen, Yixin (Washington University in St. Louis)

AAAI Conferences

Algorithmic reductions are one of the corner stones of theoretical computer science. Surprisingly, to-date, they have only played a limited role in machine learning. In this paper we introduce a formal and practical reduction between two of the most widely used machine learning algorithms: from the Elastic Net (and the Lasso as a special case) to the Support Vector Machine. First, we derive the reduction and summarize it in only 11 lines of MATLAB. Then, we demonstrate its high impact potential by translating recent advances in parallelizing SVM solvers directly to the Elastic Net. The resulting algorithm is a parallel solver for the Elastic Net (and Lasso) that naturally utilizes GPU and multi-core CPUs. We evaluate it on twelve real world data sets, and show that it yields identical results as the popular (and highly optimized) glmnet implementation but is up-to two orders of magnitude faster.


A Reduction of the Elastic Net to Support Vector Machines with an Application to GPU Computing

Zhou, Quan, Chen, Wenlin, Song, Shiji, Gardner, Jacob R., Weinberger, Kilian Q., Chen, Yixin

arXiv.org Machine Learning

The past years have witnessed many dedicated open-source projects that built and maintain implementations of Support Vector Machines (SVM), parallelized for GPU, multi-core CPUs and distributed systems. Up to this point, no comparable effort has been made to parallelize the Elastic Net, despite its popularity in many high impact applications, including genetics, neuroscience and systems biology. The first contribution in this paper is of theoretical nature. We establish a tight link between two seemingly different algorithms and prove that Elastic Net regression can be reduced to SVM with squared hinge loss classification. Our second contribution is to derive a practical algorithm based on this reduction. The reduction enables us to utilize prior efforts in speeding up and parallelizing SVMs to obtain a highly optimized and parallel solver for the Elastic Net and Lasso. With a simple wrapper, consisting of only 11 lines of MATLAB code, we obtain an Elastic Net implementation that naturally utilizes GPU and multi-core CPUs. We demonstrate on twelve real world data sets, that our algorithm yields identical results as the popular (and highly optimized) glmnet implementation but is one or several orders of magnitude faster.