arXiv Science⌕ Search

arXiv subjects

Fuhui Fang

Publications and source records attributed to Fuhui Fang.

4 recordsLinked to original sources

Building a Unified Inline Code Editing Model for GitHub Copilot

AI-assisted coding ranges from fully agentic coding to inline code suggestions in the editor. Inline suggestions require predicting a developer's most likely next edit from an editing session. The next edit may lie at the cursor, in nearby lines, or farther away, and one editing intent can span several of these. The preceding system queries separate completion, nearby edit, and long-distance edit models, each with its own output format, in a fixed sequence; it thus cannot express intents spanning distant locations in one response, can require several sequential model calls per suggestion, and prioritizes completion even when a correction would serve better. We present a unified model that predicts all three edit types in one output space: a sequence of anchored diff patches specifying locations, deleted lines, and added lines. This representation permits multiple edits per response, so the client can serve later edits from a cache without further model calls. We train this model in two phases, first unifying next edit and long-distance edit prediction, then adding code completion. We synthesize multi-edit supervision from single-edit data via model pseudolabeling and edit history playback. We use a binary LLM-graded reward, a patch validity taxonomy shared by data filtering, reward, and evaluation, and grader boosting for targeted failure modes. Phase 2 also adapts how the client processes and presents model outputs. In controlled online A/B experiments in GitHub Copilot, Phase 1 significantly reduces time to display by 6.77% and output tokens by 58.93% relative to the three-model baseline. In Phase 2, the 3-in-1 model and client adaptations reduce dismissed suggestions per user by 10.06% relative to the 2-in-1 model paired with the completion model. Throughout this report, we also share our methodology and learnings in evaluation, training, and end-to-end model and system design.

cs.SE↗

Benchmarking the Immersed Boundary Method for Viscoelastic Flows

We present and analyze a series of benchmark tests regarding the application of the immersed boundary (IB) method to viscoelastic flows through and around non-trivial, stationary geometries. The IB method is widely used for the simulation of biological fluid dynamics and other modeling scenarios where a structure is immersed in a fluid. Although the IB method has been most commonly used to model systems with viscous incompressible fluids, it also can be applied to visoelastic fluids, and has enabled the study of a wide variety of dynamical problems including the settling of vesicles and the swimming of elastic filaments in fluids modeled by the Oldroyd-B constuitive equation. However, to date, relatively little work has explored the accuracy or convergence properties of the numerical scheme. Herein, we present benchmarking results for an IB solver applied to viscoelastic flows in and around non-trivial geometries using the idealized Oldroyd-B and more realistic, polymer-entanglement-based Rolie-Poly constitutive equations. We use two-dimensional numerical test cases along with results from rheology experiments to benchmark the IB method and compare it to more complex finite element and finite volume viscoelastic flow solvers. Additionally, we analyze different choices of regularized delta function and relative Lagrangian grid spacings which allow us to identify and recommend the key choices of these numerical parameters depending on the present flow regime.

physics.flu-dyn↗

O(N) Hierarchical algorithm for computing the expectations of truncated multi-variate normal distributions in N dimensions

In this paper, we study the $N$-dimensional integral $ϕ(a,b; A) = \int_{a}^{b} H(x) f(x | A) \text{d} x$ representing the expectation of a function $H(X)$ where $f(x | A)$ is the truncated multi-variate normal (TMVN) distribution with zero mean, $x$ is the vector of integration variables for the $N$-dimensional random vector $X$, $A$ is the inverse of the covariance matrix $Σ$, and $a$ and $b$ are constant vectors. We present a new hierarchical algorithm which can evaluate $ϕ(a,b; A)$ using asymptotically optimal $O(N)$ operations when $A$ has "low-rank" blocks with "low-dimensional" features and $H(x)$ is "low-rank". We demonstrate the divide-and-conquer idea when $A$ is a symmetric positive definite tridiagonal matrix, and present the necessary building blocks and rigorous potential theory based algorithm analysis when $A$ is given by the exponential covariance model. Numerical results are presented to demonstrate the algorithm accuracy and efficiency for these two cases. We also briefly discuss how the algorithm can be generalized to a wider class of covariance models and its limitations.

math.NA↗

Hierarchical Orthogonal Matrix Generation and Matrix-Vector Multiplications in Rigid Body Simulations

In this paper, we apply the hierarchical modeling technique and study some numerical linear algebra problems arising from the Brownian dynamics simulations of biomolecular systems where molecules are modeled as ensembles of rigid bodies. Given a rigid body $p$ consisting of $n$ beads, the $6 \times 3n$ transformation matrix $Z$ that maps the force on each bead to $p$'s translational and rotational forces (a $6\times 1$ vector), and $V$ the row space of $Z$, we show how to explicitly construct the $(3n-6) \times 3n$ matrix $\tilde{Q}$ consisting of $(3n-6)$ orthonormal basis vectors of $V^{\perp}$ (orthogonal complement of $V$) using only $\mathcal{O}(n \log n)$ operations and storage. For applications where only the matrix-vector multiplications $\tilde{Q}{\bf v}$ and $\tilde{Q}^T {\bf v}$ are needed, we introduce asymptotically optimal $\mathcal{O}(n)$ hierarchical algorithms without explicitly forming $\tilde{Q}$. Preliminary numerical results are presented to demonstrate the performance and accuracy of the numerical algorithms.

math.NA↗