Searcharxiv⌕ Search

arXiv subjects

Koushik Sen

Publications and source records attributed to Koushik Sen.

At least 55 records · Page 3Linked to original sources

LLM-Assisted Code Cleaning For Training Accurate Code Generators

Natural language to code generation is an important application area of LLMs and has received wide attention from the community. The majority of relevant studies have exclusively concentrated on increasing the quantity and functional correctness of training sets while disregarding other stylistic elements of programs. More recently, data quality has garnered a lot of interest and multiple works have showcased its importance for improving performance. In this work, we investigate data quality for code and find that making the code more structured and readable leads to improved code generation performance of the system. We build a novel data-cleaning pipeline that uses these principles to transform existing programs by 1.) renaming variables, 2.) modularizing and decomposing complex code into smaller helper sub-functions, and 3.) inserting natural-language based plans via LLM based transformations. We evaluate our approach on two challenging algorithmic code generation benchmarks and find that fine-tuning CodeLLaMa-7B on our transformed modularized programs improves the performance by up to 30% compared to fine-tuning on the original dataset. Additionally, we demonstrate improved performance from using a smaller amount of higher-quality data, finding that a model fine-tuned on the entire original dataset is outperformed by a model trained on 15% of our cleaned dataset. Even in comparison to closed-source models, our models outperform the much larger AlphaCoder models.

cs.LG↗

Ansor: Generating High-Performance Tensor Programs for Deep Learning

High-performance tensor programs are crucial to guarantee efficient execution of deep neural networks. However, obtaining performant tensor programs for different operators on various hardware platforms is notoriously challenging. Currently, deep learning systems rely on vendor-provided kernel libraries or various search strategies to get performant tensor programs. These approaches either require significant engineering effort to develop platform-specific optimization code or fall short of finding high-performance programs due to restricted search space and ineffective exploration strategy. We present Ansor, a tensor program generation framework for deep learning applications. Compared with existing search strategies, Ansor explores many more optimization combinations by sampling programs from a hierarchical representation of the search space. Ansor then fine-tunes the sampled programs with evolutionary search and a learned cost model to identify the best programs. Ansor can find high-performance programs that are outside the search space of existing state-of-the-art approaches. In addition, Ansor utilizes a task scheduler to simultaneously optimize multiple subgraphs in deep neural networks. We show that Ansor improves the execution performance of deep neural networks relative to the state-of-the-art on the Intel CPU, ARM CPU, and NVIDIA GPU by up to $3.8\times$, $2.6\times$, and $1.7\times$, respectively.

cs.LG↗

ItyFuzz: Snapshot-Based Fuzzer for Smart Contract

Smart contracts are critical financial instruments, and their security is of utmost importance. However, smart contract programs are difficult to fuzz due to the persistent blockchain state behind all transactions. Mutating sequences of transactions are complex and often lead to a suboptimal exploration for both input and program spaces. In this paper, we introduce a novel snapshot-based fuzzer ItyFuzz for testing smart contracts. In ItyFuzz, instead of storing sequences of transactions and mutating from them, we snapshot states and singleton transactions. To explore interesting states, ItyFuzz introduces a dataflow waypoint mechanism to identify states with more potential momentum. ItyFuzz also incorporates comparison waypoints to prune the space of states. By maintaining snapshots of the states, ItyFuzz can synthesize concrete exploits like reentrancy attacks quickly. Because ItyFuzz has second-level response time to test a smart contract, it can be used for on-chain testing, which has many benefits compared to local development testing. Finally, we evaluate ItyFuzz on real-world smart contracts and some hacked on-chain DeFi projects. ItyFuzz outperforms existing fuzzers in terms of instructional coverage and can find and generate realistic exploits for on-chain projects quickly.

cs.CR↗

SlimFit: Memory-Efficient Fine-Tuning of Transformer-based Models Using Training Dynamics

Transformer-based models, such as BERT and ViT, have achieved state-of-the-art results across different natural language processing (NLP) and computer vision (CV) tasks. However, these models are extremely memory intensive during their fine-tuning process, making them difficult to deploy on GPUs with limited memory resources. To address this issue, we introduce a new tool called SlimFit that reduces the memory requirements of these models by dynamically analyzing their training dynamics and freezing less-contributory layers during fine-tuning. The layers to freeze are chosen using a runtime inter-layer scheduling algorithm. SlimFit adopts quantization and pruning for particular layers to balance the load of dynamic activations and to minimize the memory footprint of static activations, where static activations refer to those that cannot be discarded regardless of freezing. This allows SlimFit to freeze up to 95% of layers and reduce the overall on-device GPU memory usage of transformer-based models such as ViT and BERT by an average of 2.2x, across different NLP and CV benchmarks/datasets such as GLUE, SQuAD 2.0, CIFAR-10, CIFAR-100 and ImageNet with an average degradation of 0.2% in accuracy. For such NLP and CV tasks, SlimFit can reduce up to 3.1x the total on-device memory usage with an accuracy degradation of only up to 0.4%. As a result, while fine-tuning of ViT on ImageNet and BERT on SQuAD 2.0 with a batch size of 128 requires 3 and 2 32GB GPUs respectively, SlimFit enables their fine-tuning on a single 32GB GPU without any significant accuracy degradation.

cs.CL↗

Benchmarking Language Models for Code Syntax Understanding

Pre-trained language models have demonstrated impressive performance in both natural language processing and program understanding, which represent the input as a token sequence without explicitly modeling its structure. Some prior works show that pre-trained language models can capture the syntactic rules of natural languages without finetuning on syntax understanding tasks. However, there is limited understanding of how well pre-trained models understand the code structure so far. In this work, we perform the first thorough benchmarking of the state-of-the-art pre-trained models for identifying the syntactic structures of programs. Specifically, we introduce CodeSyntax, a large-scale dataset of programs annotated with the syntactic relationships in their corresponding abstract syntax trees. Our key observation is that existing language models pretrained on code still lack the understanding of code syntax. In fact, these pre-trained programming language models fail to match the performance of simple baselines based on positional offsets and keywords. We also present a natural language benchmark to highlight the differences between natural languages and programming languages in terms of syntactic structure understanding. Our findings point out key limitations of existing pre-training methods for programming languages, and suggest the importance of modeling code syntactic structures.

cs.CL↗

PALT: Parameter-Lite Transfer of Language Models for Knowledge Graph Completion

This paper presents a parameter-lite transfer learning approach of pretrained language models (LM) for knowledge graph (KG) completion. Instead of finetuning, which modifies all LM parameters, we only tune a few new parameters while keeping the original LM parameters fixed. We establish this via reformulating KG completion as a "fill-in-the-blank" task, and introducing a parameter-lite encoder on top of the original LMs. We show that, by tuning far fewer parameters than finetuning, LMs transfer non-trivially to most tasks and reach competitiveness with prior state-of-the-art approaches. For instance, we outperform the fully finetuning approaches on a KG completion benchmark by tuning only 1% of the parameters. The code and datasets are available at \url{https://github.com/yuanyehome/PALT}.

cs.CL↗

The Tarantula Massive Binary Monitoring VI: Characterisation of hidden companions in 51 single-lined O-type binaries, a flat mass-ratio distribution, and black-hole binary candidates

We aim to hunt for massive binaries hosting a black hole companion (OB+BH) and establish the natal mass-ratio distribution of massive stars at the subsolar metallicity environment of the Large Magellanic Cloud (LMC). We use the shift-and-add grid disentangling technique to characterize the hidden companions in 51 SB1 O-type and evolved B-type binaries in the LMC monitored in the framework of the Tarantula Massive Binary Monitoring (TMBM). Out of the 51 SB1 systems, 43 (84%) are found to have non-degenerate stellar companions, of which 28 are confident detections, and 15 are less certain (SB1: or SB2:). Of these 43 targets, one is found to be a triple (VFTS 64), and two are found to be quadruples (VFTS 120, 702). The remaining eight targets (16%) retain an SB1 classification. Aside from the unambiguous case of VFTS 243, analysed in detailed in a separate paper, we identify two additional OB+BH candidates: VFTS 514 and VFTS 779. Additional black holes may be present in the sample but at a lower probability. Our study firmly establishes a virtually flat natal mass-ratio distribution for O-type stars at LMC metallicity, covering the entire mass-ratio range (0.05 < q < 1) and periods in the range 0 < log P < 3 [d]. The nature of the OB+BH candidates should be verified through future monitoring, but the frequency of OB+BH candidates is generally in line with recent predictions at LMC metallicity.

astro-ph.SR↗

The Nature of Unseen Companions in Massive Single-Line Spectroscopic Binaries

Massive stars are predominantly found in binaries and higher order multiples. While the period and eccentricity distributions of OB stars are now well established across different metallicity regimes, the determination of mass-ratios has been mostly limited to double-lined spectroscopic binaries. As a consequence, the mass-ratio distribution remains subject to significant uncertainties. Open questions include the shape and extent of the companion mass-function towards its low-mass end and the nature of undetected companions in single-lined spectroscopic binaries. In this contribution, we present the results of a large and systematic analysis of a sample of over 80 single-lined O-type spectroscopic binaries (SB1s) in the Milky Way and in the Large Magellanic Cloud (LMC). We report on the developed methodology, the constraints obtained on the nature of SB1 companions, the distribution of O star mass-ratios at LMC metallicity and the occurrence of quiescent OB+black hole binaries.

astro-ph.SR↗

LGV: Boosting Adversarial Example Transferability from Large Geometric Vicinity

We propose transferability from Large Geometric Vicinity (LGV), a new technique to increase the transferability of black-box adversarial attacks. LGV starts from a pretrained surrogate model and collects multiple weight sets from a few additional training epochs with a constant and high learning rate. LGV exploits two geometric properties that we relate to transferability. First, models that belong to a wider weight optimum are better surrogates. Second, we identify a subspace able to generate an effective surrogate ensemble among this wider optimum. Through extensive experiments, we show that LGV alone outperforms all (combinations of) four established test-time transformations by 1.8 to 59.9 percentage points. Our findings shed new light on the importance of the geometry of the weight space to explain the transferability of adversarial examples.

cs.LG↗

An X-ray quiet black hole born with a negligible kick in a massive binary within the Large Magellanic Cloud

Stellar-mass black holes are the final remnants of stars born with more than 15 solar masses. Billions are expected to reside in the Local Group, yet only few are known, mostly detected through X-rays emitted as they accrete material from a companion star. Here, we report on VFTS 243: a massive X-ray faint binary in the Large Magellanic Cloud. With an orbital period of 10.4-d, it comprises an O-type star of 25 solar masses and an unseen companion of at least nine solar masses. Our spectral analysis excludes a non-degenerate companion at a 5-sigma confidence level. The minimum companion mass implies that it is a black hole. No other X-ray quiet black hole is unambiguously known outside our Galaxy. The (near-)circular orbit and kinematics of VFTS 243 imply that the collapse of the progenitor into a black hole was associated with little or no ejected material or black-hole kick. Identifying such unique binaries substantially impacts the predicted rates of gravitational-wave detections and properties of core-collapse supernovae across the Cosmos.

astro-ph.HE↗

Efficient and Transferable Adversarial Examples from Bayesian Neural Networks

An established way to improve the transferability of black-box evasion attacks is to craft the adversarial examples on an ensemble-based surrogate to increase diversity. We argue that transferability is fundamentally related to uncertainty. Based on a state-of-the-art Bayesian Deep Learning technique, we propose a new method to efficiently build a surrogate by sampling approximately from the posterior distribution of neural network weights, which represents the belief about the value of each parameter. Our extensive experiments on ImageNet, CIFAR-10 and MNIST show that our approach improves the success rates of four state-of-the-art attacks significantly (up to 83.2 percentage points), in both intra-architecture and inter-architecture transferability. On ImageNet, our approach can reach 94% of success rate while reducing training computations from 11.6 to 2.4 exaflops, compared to an ensemble of independently trained DNNs. Our vanilla surrogate achieves 87.5% of the time higher transferability than three test-time techniques designed for this purpose. Our work demonstrates that the way to train a surrogate has been overlooked, although it is an important element of transfer-based attacks. We are, therefore, the first to review the effectiveness of several training methods in increasing transferability. We provide new directions to better understand the transferability phenomenon and offer a simple but strong baseline for future work.

cs.LG↗

The Sky Above The Clouds

Technology ecosystems often undergo significant transformations as they mature. For example, telephony, the Internet, and PCs all started with a single provider, but in the United States each is now served by a competitive market that uses comprehensive and universal technology standards to provide compatibility. This white paper presents our view on how the cloud ecosystem, barely over fifteen years old, could evolve as it matures.

cs.DC↗

Learning Highly Recursive Input Grammars

This paper presents Arvada, an algorithm for learning context-free grammars from a set of positive examples and a Boolean-valued oracle. Arvada learns a context-free grammar by building parse trees from the positive examples. Starting from initially flat trees, Arvada builds structure to these trees with a key operation: it bubbles sequences of sibling nodes in the trees into a new node, adding a layer of indirection to the tree. Bubbling operations enable recursive generalization in the learned grammar. We evaluate Arvada against GLADE and find it achieves on average increases of 4.98x in recall and 3.13x in F1 score, while incurring only a 1.27x slowdown and requiring only 0.87x as many calls to the oracle. Arvada has a particularly marked improvement over GLADE on grammars with highly recursive structure, like those of programming languages.

cs.SE↗

Detailed evolutionary models of massive contact binaries: I. Model grids and synthetic populations for the Magellanic Clouds

The majority of close massive binary stars with initial periods of a few days experience a contact phase, in which both stars overflow their Roche lobes simultaneously. We perform the first dedicated study of the evolution of massive contact binaries and provide a comprehensive prediction of their observed properties. We compute 2790 detailed binary models for the Large and Small Magellanic Clouds each, assuming a conservative mass transfer. The initial parameter space for both grids span total masses from 20 to 80$\,\textrm{M}_{\odot}$, orbital periods of 0.6 to 2 days and mass ratios of 0.6 to 1.0. We find that models that remain in contact over nuclear timescales evolve towards equal masses, echoing the mass ratios of their observed counterparts. Ultimately, the fate of our nuclear-timescale models is to merge on the main sequence. Our predicted period-mass ratio distributions of O-type contact binaries are similar for both galaxies, and we expect 10 such systems together in both Magellanic Clouds. While we can largely reproduce the observed distribution, we over-estimate the population of equal-mass contact binaries. This situation is somewhat remedied if we also account for binaries that are approaching contact. Our theoretical distributions work particularly well for contact binaries with periods $<$2 days and total masses $\lessapprox45\,\textrm{M}_{\odot}$. We expect stellar winds, non-conservative mass transfer and envelope inflation to have played a role in the formation of the more massive and longer-period contact binaries.

astro-ph.SR↗

QFAST: Conflating Search and Numerical Optimization for Scalable Quantum Circuit Synthesis

We present a quantum synthesis algorithm designed to produce short circuits and to scale well in practice. The main contribution is a novel representation of circuits able to encode placement and topology using generic "gates", which allows the QFAST algorithm to replace expensive searches over circuit structures with few steps of numerical optimization. When compared against optimal depth, search based state-of-the-art techniques, QFAST produces comparable results: 1.19x longer circuits up to four qubits, with an increase in compilation speed of 3.6x. In addition, QFAST scales up to seven qubits. When compared with the state-of-the-art "rule" based decomposition techniques in Qiskit, QFAST produces circuits shorter by up to two orders of magnitude (331x), albeit 5.6x slower. We also demonstrate the composability with other techniques and the tunability of our formulation in terms of circuit depth and running time.

quant-ph↗

Growing a Test Corpus with Bonsai Fuzzing

This paper presents a coverage-guided grammar-based fuzzing technique for automatically generating a corpus of concise test inputs for programs such as compilers. We walk-through a case study of a compiler designed for education and the corresponding problem of generating meaningful test cases to provide to students. The prior state-of-the-art solution is a combination of fuzzing and test-case reduction techniques such as variants of delta-debugging. Our key insight is that instead of attempting to minimize convoluted fuzzer-generated test inputs, we can instead grow concise test inputs by construction using a form of iterative deepening. We call this approach Bonsai Fuzzing. Experimental results show that Bonsai Fuzzing can generate test corpora having inputs that are 16--45% smaller in size on average as compared to a fuzz-then-reduce approach, while achieving approximately the same code coverage and fault-detection capability.

cs.SE↗

Hindsight Logging for Model Training

In modern Machine Learning, model training is an iterative, experimental process that can consume enormous computation resources and developer time. To aid in that process, experienced model developers log and visualize program variables during training runs. Exhaustive logging of all variables is infeasible. Optimistic logging can be accompanied by program checkpoints; this allows developers to add log statements post-hoc, and "replay" desired log statements from checkpoint -- a process we refer to as hindsight logging. Unfortunately, hindsight logging raises tricky problems in data management and software engineering. Done poorly, hindsight logging can waste resources and generate technical debt embodied in multiple variants of training code. In this paper, we present methodologies for efficient and effective logging practices for model training, with a focus on techniques for hindsight logging. Our goal is for experienced model developers to learn and adopt these practices. To make this easier, we provide an open-source suite of tools for Fast Low-Overhead Recovery (flor) that embodies our design across three tasks: (i) efficient background logging in Python, (ii) adaptable periodic checkpointing, and (iii) an instrumentation library that codifies hindsight logging for efficient and automatic record-replay of model-training. Model developers can use each flor tool separately as they see fit, or they can use flor in hands-free mode, entrusting it to instrument their code end-to-end for efficient record-replay. Our solutions leverage techniques from physiological transaction logs and recovery in database systems. Evaluations on modern ML benchmarks demonstrate that flor can produce fast checkpointing with small user-specifiable overheads (e.g. 7%), and still provide hindsight log replay times orders of magnitude faster than restarting training from scratch.

cs.DC↗

Exempla Gratis (E.G.): Code Examples for Free

Modern software engineering often involves using many existing APIs, both open source and, in industrial coding environments, proprietary. Programmers reference documentation and code search tools to remind themselves of proper common usage patterns of APIs. However, high-quality API usage examples are computationally expensive to curate and maintain, and API usage examples retrieved from company-wide code search can be tedious to review. We present a tool, EG, that mines codebases and shows the common, idiomatic usage examples for API methods. EG was integrated into Facebook's internal code search tool for the Hack language and evaluated on open-source GitHub projects written in Python. EG was also compared against code search results and hand-written examples from a popular programming website called ProgramCreek. Compared with these two baselines, examples generated by EG are more succinct and representative with less extraneous statements. In addition, a survey with Facebook developers shows that EG examples are preferred in 97 percent of cases.

cs.SE↗