SearcharxivSearch

arXiv subjects

Martin Berglund

Publications and source records attributed to Martin Berglund.

6 recordsLinked to original sources

Selective Memoization for Efficient Backtracking Regular Expression Matching

Backtracking regular expression matchers are widely used due to their expressive power but may exhibit exponential worst-case matching time. Memoization provides a principled method for eliminating redundant computation and ensuring linear matching time, but full memoization is memory-intensive and impractical. We introduce the Minimum Feedback Node (MFN) memoization scheme, a selective memoization strategy based on computing a minimum feedback vertex set of an automaton. We establish relationships with existing memoization schemes and analyze their behaviour under both Thompson and Glushkov automaton constructions.

cs.FL

Efficient Regex Matching with Sparse Counting-Sets

Regular expressions with counting operations (c-regexes) offer a compact representation of repeating patterns by allowing numerical bounds to be added to subexpressions. Recent work introduced the counting-set data structure, which allows simultaneous updates of multiple counter values for efficient matching. However, this approach suffers from a performance bottleneck when counting-sets must be replicated due to the presence of branching transitions. We propose a sparse counting-set approach, which reduces the replication overhead by maintaining only essential counter values, thereby yielding a more efficient matching algorithm.

cs.FL

Constructing a BPE Tokenization DFA

Many natural language processing systems operate over tokenizations of text to address the open-vocabulary problem. In this paper, we give and analyze an algorithm for the efficient construction of deterministic finite automata (DFA) designed to operate directly on tokenizations produced by the popular byte pair encoding (BPE) technique. This makes it possible to apply many existing techniques and algorithms to the tokenized case, such as pattern matching, equivalence checking of tokenization dictionaries, and composing tokenized languages in various ways. The construction preserves some key properties of the automaton, and we use this to establish asymptotic bounds on the state complexity of the automata that result. Finally, we demonstrate how to construct an input-deterministic (subsequential) string-to-string transducer which precisely describes the relationship between strings and their correct tokenizations.

cs.FL

Formalizing BPE Tokenization

In this paper, we formalize practical byte pair encoding tokenization as it is used in large language models and other NLP systems, in particular we formally define and investigate the semantics of the SentencePiece and HuggingFace tokenizers, in particular how they relate to each other, depending on how the tokenization rules are constructed. Beyond this we consider how tokenization can be performed in an incremental fashion, as well as doing it left-to-right using an amount of memory constant in the length of the string, enabling e.g. using a finite state string-to-string transducer.

cs.FL

Analyzing Catastrophic Backtracking Behavior in Practical Regular Expression Matching

We develop a formal perspective on how regular expression matching works in Java, a popular representative of the category of regex-directed matching engines. In particular, we define an automata model which captures all the aspects needed to study such matching engines in a formal way. Based on this, we propose two types of static analysis, which take a regular expression and tell whether there exists a family of strings which makes Java-style matching run in exponential time.

cs.FL

Investigations of a compartmental model for leucine kinetics using nonlinear mixed effects models with ordinary and stochastic differential equations

Nonlinear mixed effects models represent a powerful tool to simultaneously analyze data from several individuals. In this study a compartmental model of leucine kinetics is examined and extended with a stochastic differential equation to model non-steady state concentrations of free leucine in the plasma. Data obtained from tracer/tracee experiments for a group of healthy control individuals and a group of individuals suffering from diabetes mellitus type 2 are analyzed. We find that the interindividual variation of the model parameters is much smaller for the nonlinear mixed effects models, compared to traditional estimates obtained from each individual separately. Using the mixed effects approach, the population parameters are estimated well also when only half of the data are used for each individual. For a typical individual the amount of free leucine is predicted to vary with a standard deviation of 8.9% around a mean value during the experiment. Moreover, leucine degradation and protein uptake of leucine is smaller, proteolysis larger, and the amount of free leucine in the body is much larger for the diabetic individuals than the control individuals. In conclusion nonlinear mixed effects models offers improved estimates for model parameters in complex models based on tracer/tracee data and may be a suitable tool to reduce data sampling in clinical studies.

q-bio.QM