Jean-Philippe Bernardy

University of Gothenburg
2 previous affiliations
57Machine learning papers tracked by Lacuna
Is this you?

Research Overview

Jean-Philippe Bernardy focuses on the intersection of functional programming, formal logic, and natural language processing. His research trajectory reflects a transition from the foundational theory of programming languages—specifically advanced type systems and parametricity—toward the development of hybrid systems that combine symbolic reasoning with neural architectures. His current work emphasizes the integration of algebraic and category-theoretic principles into deep learning, aiming to improve the structural priors, reasoning capabilities, and compositional generalization of large-scale models.

Research Trajectory

The early stages of Bernardy’s career were rooted in the rigorous formalization of programming language features. Between 2002 and 2012, his work centered on the mechanics of generic programming and the extension of type theory. A primary focus during this period was the reconciliation of different abstraction mechanisms, such as comparing C++ concepts with Haskell type classes to establish a unified taxonomy for property-based programming. This foundational period culminated in significant contributions to dependent type theory, where he explored how parametricity—the property that a polymorphic function must behave uniformly across all types—could be extended to more complex, dependently typed environments. This work provided a theoretical basis for "free" theorems and proofs within advanced functional languages.

Starting around 2017, Bernardy’s research shifted toward computational linguistics, applying the precision of functional programming to the challenges of natural language. This transition began with empirical investigations into prosodic structures and sentence acceptability. He explored the capacity of neural networks, such as LSTMs and Convolutional Neural Networks (CNNs), to capture linguistic patterns implicitly from raw text. This period was characterized by an interest in whether explicit syntactic and semantic representations could enhance model performance, ultimately finding that standard architectures often pick up these patterns without external guidance.

By 2019, his focus expanded to include Character Level Sequence Transduction for Morphology and Orthography, particularly in the context of low-resource and non-standardized languages. He led efforts to process Algerian Arabic code-switched data, developing models for orthographic normalization and investigating multi-task learning as a strategy to overcome data scarcity. This work highlighted the practical challenges of applying NLP to informal, user-generated content where traditional word-as-atom models fail.

In the early 2020s, Bernardy’s work began to synthesize these two strands—formal logic and neural NLP. He moved toward hybrid systems that utilize formal proof assistants, such as Coq, alongside grammatical frameworks to handle complex linguistic phenomena like temporal inference and anaphora resolution. This period marked a return to functional programming as a tool for AI, using Haskell to implement monadic frameworks for dynamic semantics.

His most recent research, spanning 2023 to 2025, addresses the architectural limitations of modern transformers. He has contributed to the development of Positional Encoding for Permutation Invariant Transformers, seeking "theory-first" methods to inject structural information into attention mechanisms. This work often employs algebraic groups and orthogonal matrix operators to represent positions in complex structures like trees and grids.

Current Directions

Bernardy’s current research is focused on the formalization of machine learning components and the enhancement of logical reasoning in neural models. A significant theme in his recent work is the development of domain-specific languages (DSLs) for tensor calculus. By embedding these languages in Haskell, he aims to provide a bridge between abstract mathematical notation and safe, executable code, ensuring that tensor operations remain consistent with the underlying physics or geometry they represent.

He is also actively involved in addressing the "data drought" in formal mathematics through Scaling Formal Reasoning Through Synthetic Data Generation. This involves creating automated systems capable of generating and verifying proofs in languages like Lean or Coq, thereby providing the necessary training data for models to move beyond simple memorization toward true logical deduction. Related to this is the problem of Overcoming the Premise Selection Bottleneck in Formal Mathematics, where he explores how models can efficiently identify relevant lemmas within vast mathematical repositories.

Furthermore, Bernardy continues to investigate The Lemma Generalization Gap in Neural Language Models. His work in this area critiques the perceived success of neural networks on standard benchmarks, suggesting that high accuracy often stems from lemma overlap rather than a deep understanding of internal word structure. To combat this, he explores Linear Attention Mechanisms for Subquadratic Sequence Modeling, seeking to scale these structurally-aware models to longer sequences and more complex documents without the quadratic computational cost of standard self-attention.

Representative Work

Proofs for free - Parametricity for dependent types Published in the Journal of Functional Programming in 2012, this work serves as a cornerstone of Bernardy's early theoretical research. It extends the concept of Reynolds' parametricity to dependent type theory, providing a systematic way to derive properties of programs solely from their types. By bridging the gap between simple polymorphism and dependent types, the paper established a framework for reasoning about the behavior of complex functional programs, which later influenced his approach to formalizing linguistic semantics.

Normalising Non-standardised Orthography in Algerian Code-switched User-generated Data In this 2019 EMNLP paper, Bernardy addressed the challenges of processing informal social media text. He introduced a custom CNN-LSTM sequence-to-sequence model designed to normalize the highly variable spelling and code-switching (mixing Arabic and French) characteristic of Algerian user-generated content. This work demonstrated that a dedicated normalization step significantly improves performance on downstream tasks like Semantic Textual Similarity, highlighting his shift toward practical, character-level NLP for low-resource languages.

FraCaS: Temporal Analysis This 2020 research tackled the temporal and aspectual inference section of the FraCaS test suite, often considered a benchmark for natural language understanding. By combining the Grammatical Framework (GF) for parsing with the Coq proof assistant for logical reasoning, Bernardy and his collaborator developed a system capable of handling complex time-based logic. This work represents a significant milestone in hybrid symbolic-neural NLP, achieving high accuracy on a dataset that requires sophisticated formal reasoning.

Domain-Specific Tensor Languages Published in the Journal of Functional Programming in 2023, this paper introduces two Haskell-embedded DSLs, Albert and Roger. These languages allow for the expression of tensor calculus in a manner that mirrors standard physics notation while maintaining the safety and rigor of functional programming. This work reflects Bernardy's ongoing effort to bring the benefits of strong typing and formal verification to the domain of scientific computing and machine learning.

Probabilistic compositional semantics, purely In this 2023 collaboration, Bernardy contributed to a general framework for integrating formal semantics with probabilistic reasoning. The framework uses typed λ-calculus and treats probabilistic effects—such as sampling and marginalization—as side effects via continuations. This modular approach allows for the construction of probabilistic programs within existing logical systems, facilitating applications in semantic learning and pragmatic inference within the Rational Speech Act framework.

Algebraic Positional Encodings Presented at NeurIPS 2024, this work provides a unified mathematical framework for positional encodings in Transformer architectures. By representing positions as elements of mathematical groups and using orthogonal matrix operators, the research extends positional information beyond simple sequences to more complex structures like trees and multidimensional grids. This "theory-first" approach addresses the fundamental "order-blindness" of self-attention, providing a scalable and mathematically grounded alternative to ad-hoc positional encodings.

Profile updated

See something wrong? Report a mistake