SearcharxivSearch

arXiv subjects

Yuwei Zhao

Publications and source records attributed to Yuwei Zhao.

16 recordsLinked to original sources

Multi-Source and Cross-Scenario Strategy-Guided Code Optimization

Automated code optimization improves program performance by refactoring source code, and recent studies use LLMs to generate optimization patches. The newest approaches are strategy-guided: they summarize strategies from historical optimization commits as static analysis rules, and use these rules to match code locations for LLMs to optimize. However, these approaches have two limitations: (1) the strategies may come from other knowledge sources, such as textbooks and web pages, but the existing approaches cannot utilize them; (2) a strategy may be applicable to different scenarios, e.g., different programming languages, but existing approaches can only formalize strategies for the scenario to which the source commit belongs. To address these limitations, we propose MoST, an LLM-based code optimization framework that integrates multiple knowledge sources across scenarios. MoST uniformly represents items in different knowledge sources as evidence objects, clusters them in a cross-source and cross-scenario manner to identify strategies, and transfers them to the target scenario when necessary for generating static analysis rules. To implement this process, MoST employs a novel self-balanced weighted clustering algorithm to balance evidence objects from different knowledge sources, and a novel example transfer procedure to ensure the quality of the generated rules when transferring across scenarios. On a benchmark containing 151 C/C++, 150 Python, and 50 Rust historical optimization tasks, compared with SemOpt, MoST yields 24.44%-180.00% and 21.88%-37.50% more patches that are exactly the same as or semantically equivalent to developer patches, respectively. When optimizing 15 real-world projects, MoST achieves 19.72%-717.42% maximum improvements and 4.44%-258.17% average improvements for the performance tests in the projects, significantly outperforming SemOpt and Codex.

cs.SE

Goodness-of-fit Tests for Heavy-tailed Random Fields

We develop goodness-of-fit tests for max-stable random fields, which are used to model heavy-tailed spatial data. The test statistics are constructed based on the Fourier transforms of the indicators of extreme values in the heavy-tailed spatial data, whose asymptotic distribution is a Gaussian random field under a hypothesized max-stable random field. Since the covariance structure of the limiting Gaussian random field lacks an explicit expression, we propose a stationary bootstrap procedure for spatial fields to approximate critical values. Simulation studies confirm the theoretical distributional results, and applications to PM2.5 and temperature data illustrate the practical utility of the proposed method for model assessment.

stat.ME

SemOpt: LLM-Driven Code Optimization via Rule-Based Analysis

Automated code optimization improves program performance through refactoring, and recent studies leverage LLMs for this purpose. Existing approaches mine optimization commits from open-source codebases to build large-scale knowledge bases, then employ retrieval techniques such as BM25 to obtain relevant examples for hotspot code, guiding LLMs in optimization. However, semantically equivalent optimizations often appear in syntactically dissimilar code, so current retrieval methods fail to identify pertinent examples, leading to suboptimal results. To address these limitations, we propose SemOpt, a framework that leverages static program analysis to identify code segments, retrieve optimization strategies, and generate optimized results. SemOpt has three LLM-powered components: (1) a strategy library builder that extracts and clusters strategies from code modifications, (2) a rule generator that produces Semgrep static analysis rules to capture each strategy's applicability, and (3) an optimizer that generates optimized code using the strategy library. On a benchmark of 151 C/C++ and 150 Python optimization tasks, SemOpt shows consistent improvements across different LLMs, increasing successful optimizations by 1.38 to 28 times on C/C++ and 4.60 to 6.33 times on Python versus the baseline. On large-scale projects, SemOpt improves performance metrics by 5.04% to 218.07% on C/C++ and 61.77% to 479.90% on Python, showing cross-language generalization and practical effectiveness.

cs.SE

Asymptotic Theory for Regularized Estimation in Functional Time Series Models

Functional autoregressive (FAR) models provide a fundamental framework for analyzing temporally dependent functional data. However, the infinite-dimensional nature of the underlying Hilbert space introduces intrinsic ill-posedness, as the autocovariance operators are compact and lack bounded inverses. This paper develops a new theoretical framework for the regularized estimation and asymptotic analysis of FAR models. Leveraging Hilbert space theory, we rigorously characterize the distinction between finite- and infinite-dimensional time series analysis and formalize the necessity of regularization. To stabilize the estimation of autoregressive operators, we introduce a Tikhonov regularization scheme and derive Yule-Walker-type estimators in a general Hilbert space, and further specialize to the $L^2$ space for explicit forms. Within this unified framework, we establish the consistency and asymptotic normality of the regularized estimators and reveal that asymptotic normality can be achieved only for the predictors rather than the operator estimates themselves. Furthermore, we derive the mean squared prediction error (MSPE) and decompose its bias-variance structure. A comprehensive simulation study and an application to high-frequency functional data from wearable devices demonstrate the practical validity of the theory and the ability of FAR models to capture dynamic functional patterns.

stat.ME

Time-lagged marginal expected shortfall

Marginal expected shortfall (MES) is an important measure when assessing and quantifying the contribution of the financial institution to a systemic crisis. In this paper, we propose time-lagged marginal expected shortfall (TMES) as a dynamic extension of the MES, accounting for time lags in assessing systemic risks. A natural estimator for the TMES is proposed, and its asymptotic properties are studied. To address challenges in constructing confidence intervals for the TMES in practice, we apply the stationary bootstrap method to generate confidence bands for the TMES estimator. Extensive simulation studies were conducted to investigate the asymptotic properties of empirical and bootstrapped TMES. Two practical applications of TMES, supported by real data analyses, effectively demonstrate its ability to account for time lags in risk assessment.

stat.ME

S&P 500 Trend Prediction

This project aims to predict short-term and long-term upward trends in the S&P 500 index using machine learning models and feature engineering based on the "101 Formulaic Alphas" methodology. The study employed multiple models, including Logistic Regression, Decision Trees, Random Forests, Neural Networks, K-Nearest Neighbors (KNN), and XGBoost, to identify market trends from historical stock data collected from Yahoo! Finance. Data preprocessing involved handling missing values, standardization, and iterative feature selection to ensure relevance and variability. For short-term predictions, KNN emerged as the most effective model, delivering robust performance with high recall for upward trends, while for long-term forecasts, XGBoost demonstrated the highest accuracy and AUC scores after hyperparameter tuning and class imbalance adjustments using SMOTE. Feature importance analysis highlighted the dominance of momentum-based and volume-related indicators in driving predictions. However, models exhibited limitations such as overfitting and low recall for positive market movements, particularly in imbalanced datasets. The study concludes that KNN is ideal for short-term alerts, whereas XGBoost is better suited for long-term trend forecasting. Future enhancements could include advanced architectures like Long Short-Term Memory (LSTM) networks and further feature refinement to improve precision and generalizability. These findings contribute to developing reliable machine learning tools for market trend prediction and investment decision-making.

q-fin.CP

CodeJudge-Eval: Can Large Language Models be Good Judges in Code Understanding?

Recent advancements in large language models (LLMs) have showcased impressive code generation capabilities, primarily evaluated through language-to-code benchmarks. However, these benchmarks may not fully capture a model's code understanding abilities. We introduce CodeJudge-Eval (CJ-Eval), a novel benchmark designed to assess LLMs' code understanding abilities from the perspective of code judging rather than code generation. CJ-Eval challenges models to determine the correctness of provided code solutions, encompassing various error types and compilation issues. By leveraging a diverse set of problems and a fine-grained judging system, CJ-Eval addresses the limitations of traditional benchmarks, including the potential memorization of solutions. Evaluation of 12 well-known LLMs on CJ-Eval reveals that even state-of-the-art models struggle, highlighting the benchmark's ability to probe deeper into models' code understanding abilities. Our codes and benchmark are available at \url{https://github.com/CodeLLM-Research/CodeJudge-Eval}.

cs.SE

GLGait: A Global-Local Temporal Receptive Field Network for Gait Recognition in the Wild

Gait recognition has attracted increasing attention from academia and industry as a human recognition technology from a distance in non-intrusive ways without requiring cooperation. Although advanced methods have achieved impressive success in lab scenarios, most of them perform poorly in the wild. Recently, some Convolution Neural Networks (ConvNets) based methods have been proposed to address the issue of gait recognition in the wild. However, the temporal receptive field obtained by convolution operations is limited for long gait sequences. If directly replacing convolution blocks with visual transformer blocks, the model may not enhance a local temporal receptive field, which is important for covering a complete gait cycle. To address this issue, we design a Global-Local Temporal Receptive Field Network (GLGait). GLGait employs a Global-Local Temporal Module (GLTM) to establish a global-local temporal receptive field, which mainly consists of a Pseudo Global Temporal Self-Attention (PGTA) and a temporal convolution operation. Specifically, PGTA is used to obtain a pseudo global temporal receptive field with less memory and computation complexity compared with a multi-head self-attention (MHSA). The temporal convolution operation is used to enhance the local temporal receptive field. Besides, it can also aggregate pseudo global temporal receptive field to a true holistic temporal receptive field. Furthermore, we also propose a Center-Augmented Triplet Loss (CTL) in GLGait to reduce the intra-class distance and expand the positive samples in the training stage. Extensive experiments show that our method obtains state-of-the-art results on in-the-wild datasets, $i.e.$, Gait3D and GREW. The code is available at https://github.com/bgdpgz/GLGait.

cs.CV

Whittle estimation based on the extremal spectral density of a heavy-tailed random field

We consider a strictly stationary random field on the two-dimensional integer lattice with regularly varying marginal and finite-dimensional distributions. Exploiting the regular variation, we define the spatial extremogram which takes into account only the largest values in the random field. This extremogram is a spatial autocovariance function. We define the corresponding extremal spectral density and its estimator, the extremal periodogram. Based on the extremal periodogram, we consider the Whittle estimator for suitable classes of parametric random fields including the Brown-Resnick random field and regularly varying max-moving averages.

math.ST

Decomposition-Based Synthesis for Applying Divide-and-Conquer-Like Algorithmic Paradigms

Algorithmic paradigms such as divide-and-conquer (D&C) are proposed to guide developers in designing efficient algorithms, but it can still be difficult to apply algorithmic paradigms to practical tasks. To ease the usage of paradigms, many research efforts have been devoted to the automatic application of algorithmic paradigms. However, most existing approaches to this problem rely on syntax-based program transformations and thus put significant restrictions on the original program. In this paper, we study the automatic application of D&C and several similar paradigms, denoted as D&C-like algorithmic paradigms, and aim to remove the restrictions from syntax-based transformations. To achieve this goal, we propose an efficient synthesizer, named AutoLifter, which does not depend on syntax-based transformations. Specifically, the main challenge of applying algorithmic paradigms is from the large scale of the synthesized programs, and AutoLifter addresses this challenge by applying two novel decomposition methods that do not depend on the syntax of the input program, component elimination and variable elimination, to soundly divide the whole problem into simpler subtasks, each synthesizing a sub-program of the final program and being tractable with existing synthesizers. We evaluate AutoLifter on 96 programming tasks related to 6 different algorithmic paradigms. AutoLifter solves 82/96 tasks with an average time cost of 20.17 seconds, significantly outperforming existing approaches.

cs.PL

Exploring home robot capabilities by medium fidelity prototyping

In order for autonomous robots to be able to support people's well-being in homes and everyday environments, new interactive capabilities will be required, as exemplified by the soft design used for Disney's recent robot character Baymax in popular fiction. Home robots will be required to be easy to interact with and intelligent--adaptive, fun, unobtrusive and involving little effort to power and maintain--and capable of carrying out useful tasks both on an everyday level and during emergencies. The current article adopts an exploratory medium fidelity prototyping approach for testing some new robotic capabilities in regard to recognizing people's activities and intentions and behaving in a way which is transparent to people. Results are discussed with the aim of informing next designs.

cs.RO

Point processes in a metric space

As a useful and elegant tool of extreme value theory, the study of point processes on a metric space is important and necessary for the analyses of heavy-tailed functional data. This paper focuses on the definition and properties of such point processes. A complete convergence result for a regularly varying iid sequence in a metric space is proved as an example of the application in extreme value theory.

math.PR

Polar decomposition of regularly varying time series in star-shaped metric spaces

There exist two ways of defining regular variation of a time series in a star-shaped metric space: either by the distributions of finite stretches of the series or by viewing the whole series as a single random element in a sequence space. The two definitions are shown to be equivalent. The introduction of a norm-like function, called modulus, yields a polar decomposition similar to the one in Euclidean spaces. The angular component of the time series, called angular or spectral tail process, captures all aspects of extremal dependence. The stationarity of the underlying series induces a transformation formula of the spectral tail process under time shifts.

math.PR

The integrated periodogram of a dependent extremal event sequence

We investigate the asymptotic properties of the integrated periodogram calculated from a sequence of indicator functions of dependent extremal events. An event in Euclidean space is extreme if it occurs far away from the origin. We use a regular variation condition on the underlying stationary sequence to make these notions precise. Our main result is a functional central limit theorem for the integrated periodogram of the indicator functions of dependent extremal events. The limiting process is a continuous Gaussian process whose covari- ance structure is in general unfamiliar, but in the iid case a Brownian bridge appears. In the general case, we propose a stationary bootstrap procedure for approximating the distribution of the limiting process. The developed theory can be used to construct classical goodness-of-fit tests such as the Grenander- Rosenblatt and Cramér-von Mises tests which are based only on the extremes in the sample. We apply the test statistics to simulated and real-life data.

math.ST

A Fourier analysis of extreme events

The extremogram is an asymptotic correlogram for extreme events constructed from a regularly varying stationary sequence. In this paper, we define a frequency domain analog of the correlogram: a periodogram generated from a suitable sequence of indicator functions of rare events. We derive basic properties of the periodogram such as the asymptotic independence at the Fourier frequencies and use this property to show that weighted versions of the periodogram are consistent estimators of a spectral density derived from the extremogram.

math.ST

Measures of serial extremal dependence and their estimation

The goal of this paper is two-fold: 1. We review classical and recent measures of serial extremal dependence in a strictly stationary time series as well as their estimation. 2. We discuss recent concepts of heavy-tailed time series, including regular variation and max-stable processes. Serial extremal dependence is typically characterized by clusters of exceedances of high thresholds in the series. We start by discussing the notion of extremal index of a univariate sequence, i.e. the reciprocal of the expected cluster size, which has attracted major attention in the extremal value literature. Then we continue by introducing the extremogram which is an asymptotic auto-correlation function for sequences of extremal events in a time series. In this context, we discuss regular variation of a time series. This notion has been useful for describing serial extremal dependence and heavy tails in a strictly stationary sequence. We briefly discuss the tail process coined by Basrak and Segers to describe the dependence structure of regularly varying sequences in a probabilistic way. Max-stable processes with Frechet marginals are an important class of reg- ularly varying sequences. Recently, this class has attracted attention for modeling and statistical purposes. We apply the extremogram to max-stable processes. Finally, we discuss estimation of the extremogram both in the time and frequency domains.

math.ST