SearcharxivSearch

arXiv subjects

Babak Rahmani

Publications and source records attributed to Babak Rahmani.

18 recordsLinked to original sources

RevengeBench: Reverse Engineering Code-Space Policies from Behavioral Experiments

For most of scientific history, researchers studying behavior could only infer hidden mechanisms from outward actions: an inverse problem that becomes more tractable when observation is augmented by targeted intervention. We pose a computational analogue: given only behavioral traces of an agent in a game environment, can a learner reconstruct the underlying decision program as executable code, and how much does this reconstruction improve with the ability to design controlled experiments? We introduce RevengeBench, a benchmark of 75 LLM generated, Elo-calibrated policies across five game environments, drawn from CodeClash tournament trajectories. The learner observes the hidden target policy play against sampled opponents and designs behavioral probes in the form of custom opponent policies that elicit informative behavior. It then submits an executable hypothesis, which is evaluated using continuous action-distance metrics. We further validate that recovered code carries informative signal in downstream player-versus-player tournaments. Across twelve frontier LLMs, recovery quality varies substantially (34 to 72% of initial distance closed), with reconstructed policies yielding measurable competitive advantage, particularly for weaker models that otherwise struggle to design effective counter-strategies. Our benchmark positions behavioral recovery of programmatic policies as a tractable inverse problem in code-space, opening a path to opponent modeling, policy interpretability, and the broader question of inferring latent mechanisms from observations.

cs.LG

Learning State-Tracking from Code Using Linear RNNs

Over the last years, state-tracking tasks, particularly permutation composition, have become a testbed to understand the limits of sequence models architectures like Transformers and RNNs (linear and non-linear). However, these are often sequence-to-sequence tasks: learning to map actions (permutations) to states, which is incompatible with the next-token prediction setting commonly used to train language models. We address this gap by converting permutation composition into code via REPL traces that interleave state-reveals through prints and variable transformations. We show that linear RNNs capable of state-tracking excel also in this setting, while Transformers still fail. Motivated by this representation, we investigate why tracking states in code is generally difficult: actions are not always fully observable. We frame this as tracking the state of a probabilistic finite-state automaton with deterministic state reveals and show that linear RNNs can be worse than non-linear RNNs at tracking states in this setup.

cs.LG

Debugging code world models

Code World Models (CWMs) are language models trained to simulate program execution by predicting explicit runtime state after every executed command. This execution-based world modeling enables internal verification within the model, offering an alternative to natural language chain-of-thought reasoning. However, the sources of errors and the nature of CWMs' limitations remain poorly understood. We study CWMs from two complementary perspectives: local semantic execution and long-horizon state tracking. On real-code benchmarks, we identify two dominant failure regimes. First, dense runtime state reveals produce token-intensive execution traces, leading to token-budget exhaustion on programs with long execution histories. Second, failures disproportionately concentrate in string-valued state, which we attribute to limitations of subword tokenization rather than program structure. To study long-horizon behavior, we use a controlled permutation-tracking benchmark that isolates state propagation under action execution. We show that long-horizon degradation is driven primarily by incorrect action generation: when actions are replaced with ground-truth commands, a Transformer-based CWM propagates state accurately over long horizons, despite known limitations of Transformers in long-horizon state tracking. These findings suggest directions for more efficient supervision and state representations in CWMs that are better aligned with program execution and data types.

cs.SE

Implicit Language Models are RNNs: Balancing Parallelization and Expressivity

State-space models (SSMs) and transformers dominate the language modeling landscape. However, they are constrained to a lower computational complexity than classical recurrent neural networks (RNNs), limiting their expressivity. In contrast, RNNs lack parallelization during training, raising fundamental questions about the trade off between parallelization and expressivity. We propose implicit SSMs, which iterate a transformation until convergence to a fixed point. Theoretically, we show that implicit SSMs implement the non-linear state-transitions of RNNs. Empirically, we find that only approximate fixed-point convergence suffices, enabling the design of a scalable training curriculum that largely retains parallelization, with full convergence required only for a small subset of tokens. Our approach demonstrates superior state-tracking capabilities on regular languages, surpassing transformers and SSMs. We further scale implicit SSMs to natural language reasoning tasks and pretraining of large-scale language models up to 1.3B parameters on 207B tokens representing, to our knowledge, the largest implicit model trained to date. Notably, our implicit models outperform their explicit counterparts on standard benchmarks. Our code is publicly available at http://github.com/microsoft/implicit_languagemodels .

cs.LG

Training of Physical Neural Networks

Physical neural networks (PNNs) are a class of neural-like networks that leverage the properties of physical systems to perform computation. While PNNs are so far a niche research area with small-scale laboratory demonstrations, they are arguably one of the most underappreciated important opportunities in modern AI. Could we train AI models 1000x larger than current ones? Could we do this and also have them perform inference locally and privately on edge devices, such as smartphones or sensors? Research over the past few years has shown that the answer to all these questions is likely "yes, with enough research": PNNs could one day radically change what is possible and practical for AI systems. To do this will however require rethinking both how AI models work, and how they are trained - primarily by considering the problems through the constraints of the underlying hardware physics. To train PNNs at large scale, many methods including backpropagation-based and backpropagation-free approaches are now being explored. These methods have various trade-offs, and so far no method has been shown to scale to the same scale and performance as the backpropagation algorithm widely used in deep learning today. However, this is rapidly changing, and a diverse ecosystem of training techniques provides clues for how PNNs may one day be utilized to create both more efficient realizations of current-scale AI models, and to enable unprecedented-scale models.

physics.app-ph

Backpropagation-free Training of Deep Physical Neural Networks

Recent years have witnessed the outstanding success of deep learning in various fields such as vision and natural language processing. This success is largely indebted to the massive size of deep learning models that is expected to increase unceasingly. This growth of the deep learning models is accompanied by issues related to their considerable energy consumption, both during the training and inference phases, as well as their scalability. Although a number of work based on unconventional physical systems have been proposed which addresses the issue of energy efficiency in the inference phase, efficient training of deep learning models has remained unaddressed. So far, training of digital deep learning models mainly relies on backpropagation, which is not suitable for physical implementation as it requires perfect knowledge of the computation performed in the so-called forward pass of the neural network. Here, we tackle this issue by proposing a simple deep neural network architecture augmented by a biologically plausible learning algorithm, referred to as "model-free forward-forward training". The proposed architecture enables training deep physical neural networks consisting of layers of physical nonlinear systems, without requiring detailed knowledge of the nonlinear physical layers' properties. We show that our method outperforms state-of-the-art hardware-aware training methods by improving training speed, decreasing digital computations, and reducing power consumption in physical systems. We demonstrate the adaptability of the proposed method, even in systems exposed to dynamic or unpredictable external perturbations. To showcase the universality of our approach, we train diverse wave-based physical neural networks that vary in the underlying wave phenomenon and the type of non-linearity they use, to perform vowel and image classification tasks experimentally.

cs.LG

Roadmap on Wavefront Shaping and deep imaging in complex media

The last decade has seen the development of a wide set of tools, such as wavefront shaping, computational or fundamental methods, that allow to understand and control light propagation in a complex medium, such as biological tissues or multimode fibers. A vibrant and diverse community is now working on this field, that has revolutionized the prospect of diffraction-limited imaging at depth in tissues. This roadmap highlights several key aspects of this fast developing field, and some of the challenges and opportunities ahead.

physics.optics

Variational framework for partially-measured physical system control: examples of vision neuroscience and optical random media

To characterize a physical system to behave as desired, either its underlying governing rules must be known a priori or the system itself be accurately measured. The complexity of full measurements of the system scales with its size. When exposed to real-world conditions, such as perturbations or time-varying settings, the system calibrated for a fixed working condition might require non-trivial re-calibration, a process that could be prohibitively expensive, inefficient and impractical for real-world use cases. In this work, we propose a learning procedure to obtain a desired target output from a physical system. We use Variational Auto-Encoders (VAE) to provide a generative model of the system function and use this model to obtain the required input of the system that produces the target output. We showcase the applicability of our method for two datasets in optical physics and neuroscience.

cs.LG

All-fiber spatiotemporally mode-locked laser with multimode fiber-based filtering

We demonstrate the first multimode fiber interference-based filtering in an all-fiber spatiotemporally mode-locked laser. The oscillator generates dissipative soliton pulses at 1036 nm with 12 mW average power, 6.24 ps duration and 24.3 MHz repetition rate. The reported pulse energy (0.5 nJ) represents ~4 times improvement over the previously reported single-mode all-normal dispersion mode-locked lasers with multimode interference-based filtering. Numerical simulations are performed to reveal cavity and spatiotemporal mode-locking dynamics. The proposed oscillator presents an alternative approach to achieve spatiotemporal mode-locking with an all-fiber design that can be fabricated simply.

physics.optics

Single mode output by controlling the spatiotemporal nonlinearities in mode-locked femtosecond multimode fiber lasers

The performance of fiber mode-locked lasers is limited due to the high nonlinearity induced by the spatial confinement of the single-mode fiber core. To massively increase the pulse energy of the femtosecond pulses, amplification is obtained outside the oscillator. Recently, spatiotemporal mode-locking has been proposed as a new path to fiber lasers. However, the beam quality was either highly multimode and/or with low pulse energy. Here we present an approach to reach high energy per pulse directly in the mode-locked multimode fiber oscillator with a near single-mode output beam. Our approach relies on spatial self-beam cleaning via the nonlinear Kerr effect and we demonstrate a multimode fiber oscillator with M2<1.13 beam profile, up to 24 nJ energy and sub-100 fs compressed duration. The reported approach is further power scalable with larger core sized fibers and could benefit applications that require high power ultrashort lasers with commercially available optical fibers.

physics.optics

Competing Neural Networks for Robust Control of Nonlinear Systems

The output of physical systems is often accessible by measurements such as the 3D position of a robotic arm actuated by many actuators or the speckle patterns formed by shining the spot of a laser pointer on a wall. The selection of the input of such a system (actuators and the shape of the laser spot respectively) to obtain a desired output is difficult because it is an ill-posed problem i.e. there are multiple inputs yielding the same output. In this paper, we propose an approach that provides a robust solution to this dilemma for any physical system. We show that it is possible to find the appropriate input of a system that results in a desired output, despite the input-output relation being nonlinear and\or with incomplete measurements of the systems variables. We showcase our approach using an extremely ill-posed problem in imaging. We demonstrate the projection of arbitrary shapes through a multimode fiber (MMF) when a sample of intensity-only measurements are taken at the output. We show image projection fidelity as high as ~90 %, which is on par with the gold standard methods which characterize the system fully by phase and amplitude measurements. The generality as well as simplicity of the proposed approach provides a new way of target-oriented control in real-world applications.

physics.optics

Wide-Band/Angle Blazed Dual Mode Metallic Groove Gratings

We introduce a new and simple approach to acquire wide-band/angle blazing operation in one-dimensional metallic gratings supported by equivalent circuit analysis. The gratings that are investigated here are single-groove gratings that support two propagating guided modes. It is shown that under such operating conditions, one can achieve blazing over a wide range of frequencies and angles. Parameters of the proposed equivalent circuit model for the case of the transverse magnetic (TM) polarization are analytically derived. The accuracy of the models is verified through comparison against results of full-wave simulations. The procedure to achieve wide-band/angle blazing performance is delineated and the design parameters are explicitly given. It is shown that this structure is able to strongly transfer the power of the transverse magnetic (TM) polarized incident wave to the -1-th diffraction order with a fractional bandwidth of 50 % at working frequency f_0 equal to 10 GHz and for -10 dB specular reflection loss, thus realizing a broadband structure. From the circuit model, an insightful discussion is presented at various mechanisms at play, when Bragg and off-Bragg blazing occurs and fully justifies the behavior of the device. The proposed technique opens up new vistas in a wide range of applications such as spectroscopy, Littrow cavities, beam splitters, and frequency scanned antenna reflectors.

physics.class-ph

Controlling spatiotemporal nonlinearities in multimode fibers with deep neural networks

Spatiotemporal nonlinear interactions in multimode fibers are of interest for beam shaping and frequency conversion by exploiting the nonlinear propagation of different pump regimes from quasi-continuous wave to ultrashort pulses centered around visible to infrared pump wavelengths. The nonlinear effects in multi-mode fibers depend strongly on the excitation condition, however relatively little work has been reported on this subject. Here, we present the first machine learning approach to learn and control the nonlinear frequency conversion inside multimode fibers by tailoring the excitation condition via deep neural networks. Trained with experimental data, deep neural networks are adapted to learn the relation between the spatial beam profile of the pump pulse and the spectrum generation. For different user-defined target spectra, network-suggested beam shapes are applied and control over the cascaded Raman scattering and supercontinuum generation processes are achieved. Our results present a novel method to tune the spectra of a broadband source.

physics.optics

Spatiotemporal self-similar fiber laser

In this Letter, we demonstrate, to the best of our knowledge, the first spatiotemporally mode-locked fiber laser with self-similar pulse evolution. The multimode fiber oscillator generates parabolic amplifier similaritons at 1030 nm with 90 mW average power, 2.3 ps duration, and 37.9 MHz repetition rate. Remarkably, we observe experimentally a near-Gaussian beam quality (M^2<1.4) at the output of the highly multimode fiber. The output pulses are compressed to 192 fs via an external grating compressor. Numerical simulations are performed to investigate the cavity dynamics which confirm experimental observations of self-similar pulse propagation. The reported results open a new direction to investigate new types of pulse besides beam shaping and nonlinear dynamics in spatiotemporal mode-locked fiber lasers.

physics.optics

Multimode Optical Fiber Transmission with a Deep Learning Network

Multimode fibers (MMF) are an example of a highly scattering medium which scramble the coherent light propagating within them and produce seemingly random patterns. Thus, for applications such as imaging and image projection through a MMF, careful measurements of the relationship between inputs and outputs of the fiber are required. We show, as a proof of concept, that a deep learning neural network can learn the input-output relationship in a 0.75 m long MMF. Specifically, we demonstrate that a deep convolutional neural network (CNN) can learn the non-linear relationships between the amplitude of the speckle pattern obtained at the output of the fiber and the phase or amplitude at the input of the fiber. Effectively the network performs a non-linear inversion task. We obtained image fidelity (correlation) of ~98% compared with the image obtained using the measured matrix of the system. We further show that the network can be trained for transfer learning, i.e. it can transmit images through the MMF which belongs to another class which were not used for training/testing.

physics.optics

Accurate Effective Medium Theory for the Analysis of Spoof Localized Surface Plasmons in Textured Metallic Cylinders

It has been recently demonstrated that textured closed surfaces which are made out of perfect electric conductors (PECs) can mimic highly localized surface plasmons (LSPs). Here, we propose an effective medium which can accurately model LSP resonances in a two-dimensional periodically decorated PEC cylinder. The accuracy of previous models is limited to structures with deep-subwavelength and high number of grooves. However, we show that our model can successfully predict the ultra-sharp LSP resonances which exist in structures with relatively lower number of grooves. Such resonances are not correctly predictable with previous models that give some spurious resonances. The success of the proposed model is indebted to the incorporation of an effective surface conductivity which is created at the interface of the cylinder and the homogeneous medium surrounding the structure. This surface conductivity models the effect of higher diffracted orders which are excited in the periodic structure. The validity of the proposed model is verified by full-wave simulations.

physics.optics

Effect of Graphene on the Absorption and Extraordinary Transmission of Light in One Dimensional Metallic Gratings

Periodic metallic structures are known to support resonant extraordinary transmission (EOT). When covered with graphene, these structures can be employed to effectively manipulate the light. In this work, we propose an analytical circuit model for graphene-covered one-dimensional metallic gratings. By using the circuit theory, we demonstrate that one-dimensional periodic array of cut-through slits which are covered by a continuous graphene sheet exhibit tunable EOT resonance whose amplitude, unlike its spectral position, can be dynamically tuned by varying the Fermi level of graphene. In this fashion, it is shown that placing a perfect reflector at the bottom of the graphene-covered metallic grating results in the realization of a graphene-based absorber. By utilizing the circuit theory, it is illustrated that perfect absorption in the structure is not exclusive to the TM polarization, but also the TE polarized plane waves can be completely absorbed by duly adjusting the Fermi level of graphene. Criteria for the enhanced absorption are accordingly presented. Results of this work may provide a useful tool for designing novel devices based on the graphene-covered metallic gratings such as filters, modulators and efficient absorbers.

physics.optics

Modeling of Periodic Array of Cut-through Slits with Periodic Surface Conductivity at the Interfaces of an Anisotropic Medium

A periodic arrangement of one-dimensional slits carved in perfect electric conductor is investigated and an equivalent model based on the effective medium theory is derived. The proposed model is no longer fully homogeneous and features periodic surface conductivity on its upper and lower interfaces. Therefore, and in sheer contrast to all the previous attempts that were successful in mimicking only the zeroth-order diffracted waves, it is capable of emulating both specular and non-specular diffraction orders. The parameters of the equivalent model are found by comparing the scattered waves of the proposed model against those of the original structure obtained by invoking the rigorous mode matching technique based on the single mode approximation inside the slits. The proposed model is characterized by diagonal anisotropic permittivity and permeability tensors together with a periodic surface conductivity at the interfaces of the metallic grating and the ambient environment. The accuracy of the model is verified by the full-wave simulations. The proposed approach might be useful for devising applications which work based on the characteristics of higher Floquet orders.

physics.optics