Searcharxiv⌕ Search

arXiv subjects

Shaked Leibzirer

Publications and source records attributed to Shaked Leibzirer.

2 recordsLinked to original sources

SemChunk-C: Semantic Segmentation for C Code

Semantic segmentation of code written in a C-family language remains a challenging problem, due to the language's complex syntax, macro expansion, and irregular structural patterns. Existing chunking methods, such as fixed-sized windows, heuristic splitting, and syntax-based tools, often fail to capture meaningful functional units, limiting the efficacy of retrieval and other downstream LLM driven tasks. In this paper, we address the problem of chunking in C-related languages. First, we define a set of code chunk categories. Second, we train an LLM-based classifier to a) identify chunk boundaries, and b) assign each chunk a descriptive functional attribute (a category), which can be useful for downstream tasks. By leveraging the LLM's ability to capture semantic context within the code, we assume flexible chunk boundaries, allowing to adapt to the specific structure and context of each instance. Third, we introduce SemChunk-C, a family of lightweight language models for semantic chunking of C-related files (.c, .cpp, .h, .cs, etc.). These models are based on the first four Ettin encoders [1] with 17M, 32M, 68M, and 150M parameters. Despite their relatively small size, they are capable of identifying cohesive code units, such as data structures, interface blocks, and other components. Furthermore, we demonstrate the robustness of our approach on real-world code, including challenging constructs such as nested definitions and macros. We test our approach on various datasets, and show that it achieves high boundary accuracy and semantic coherence, matching or outperforming chunkers that are based on much larger code-oriented LLMs. We also validate the improved performance of the downstream tasks on a few curated benchmarks.

cs.SE↗

Eigenvalues and spectral gap in sparse random simplicial complexes

We consider the adjacency operator $A$ of the Linial-Meshulam model $X(d,n,p)$ for random $d-$dimensional simplicial complexes on $n$ vertices, where each $d-$cell is added independently with probability $p\in[0,1]$ to the complete $(d-1)$-skeleton. We consider sparse random matrices $H$, which are generalizations of the centered and normalized adjacency matrix $\mathcal{A}:=(np(1-p))^{-1/2}\cdot(A-\mathbb{E}\left[A\right])$, obtained by replacing the Bernoulli$(p)$ random variables used to construct $A$ with arbitrary bounded distribution $Z$. We obtain bounds on the expected Schatten norm of $H$, which allow us to prove results on eigenvalue confinement and in particular that $\left\Vert H\right\Vert _{2}$ converges to $2\sqrt{d}$ both in expectation and $\mathbb{P}-$almost surely as $n\to\infty$, provided that $\mathrm{Var}(Z)\gg\frac{\log n}{n}$. The main ingredient in the proof is a generalization of [LVHY18,Theorem 4.8] to the context of high-dimensional simplicial complexes, which may be regarded as sparse random matrix models with dependent entries.

math.PR↗