SearcharxivSearch

arXiv subjects

Mehdi Jafari

Publications and source records attributed to Mehdi Jafari.

At least 19 recordsLinked to original sources

SOCIA-EVO: Automated Simulator Construction via Dual-Anchored Bi-Level Optimization

Automated simulator construction requires distributional fidelity, distinguishing it from generic code generation. We identify two failure modes in long-horizon LLM agents: contextual drift and optimization instability arising from conflating structural and parametric errors. We propose SOCIA-EVO, a dual-anchored evolutionary framework. SOCIA-EVO introduces: (1) a static blueprint to enforce empirical constraints; (2) a bi-level optimization to decouple structural refinement from parameter calibration; and (3) a self-curating Strategy Playbook that manages remedial hypotheses via Bayesian-weighted retrieval. By falsifying ineffective strategies through execution feedback, SOCIA-EVO achieves robust convergence, generating simulators that are statistically consistent with observational data. The code and data of SOCIA-EVO are available here: https://github.com/cruiseresearchgroup/SOCIA/tree/evo.

cs.AI

Is my model "mind blurting"? Interpreting the dynamics of reasoning tokens with Recurrence Quantification Analysis (RQA)

Test-time compute is central to large reasoning models, yet analysing their reasoning behaviour through generated text is increasingly impractical and unreliable. Response length is often used as a brute proxy for reasoning effort, but this metric fails to capture the dynamics and effectiveness of the Chain of Thoughts (CoT) or the generated tokens. We propose Recurrence Quantification Analysis (RQA) as a non-textual alternative for analysing model's reasoning chains at test time. By treating token generation as a dynamical system, we extract hidden embeddings at each generation step and apply RQA to the resulting trajectories. RQA metrics, including Determinism and Laminarity, quantify patterns of repetition and stalling in the model's latent representations. Analysing 3,600 generation traces from DeepSeek-R1-Distill, we show that RQA captures signals not reflected by response length, but also substantially improves prediction of task complexity by 8\%. These results help establish RQA as a principled tool for studying the latent token generation dynamics of test-time scaling in reasoning models.

cs.CL

Mechanistic Indicators of Steering Effectiveness in Large Language Models

Activation-based steering enables Large Language Models (LLMs) to exhibit targeted behaviors by intervening on intermediate activations without retraining. Despite its widespread use, the mechanistic factors that govern when steering succeeds or fails remain poorly understood, as prior work has relied primarily on black-box outputs or LLM-based judges. In this study, we investigate whether the reliability of steering can be diagnosed using internal model signals. We focus on two information-theoretic measures: the entropy-derived Normalized Branching Factor (NBF), and the Kullback-Leibler (KL) divergence between steered activations and targeted concepts in the vocabulary space. We hypothesize that effective steering corresponds to structured entropy preservation and coherent KL alignment across decoding steps. Building on a reliability study demonstrating high inter-judge agreement between two architecturally distinct LLMs, we use LLM-generated annotations as ground truth and show that these mechanistic signals provide meaningful predictive power for identifying successful steering and estimating failure probability. We further introduce a stronger evaluation baseline for Contrastive Activation Addition (CAA) and Sparse Autoencoder-based steering, the two most widely adopted activation-steering methods.

cs.CL

SOCIA-Nabla: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generation

In this paper, we present SOCIA-Nabla, an end-to-end, agentic framework that treats simulator construction asinstance optimization over code within a textual computation graph. Specialized LLM-driven agents are embedded as graph nodes, and a workflow manager executes a loss-driven loop: code synthesis -> execution -> evaluation -> code repair. The optimizer performs Textual-Gradient Descent (TGD), while human-in-the-loop interaction is reserved for task-spec confirmation, minimizing expert effort and keeping the code itself as the trainable object. Across three CPS tasks, i.e., User Modeling, Mask Adoption, and Personal Mobility, SOCIA-Nabla attains state-of-the-art overall accuracy. By unifying multi-agent orchestration with a loss-aligned optimization view, SOCIA-Nabla converts brittle prompt pipelines into reproducible, constraint-aware simulator code generation that scales across domains and simulation granularities. This work is under review, and we will release the code soon.

cs.AI

SOCIA-$\nabla$: Textual Gradient Meets Multi-Agent Orchestration for Automated Simulator Generation

In this paper, we present SOCIA-$\nabla$, an end-to-end, agentic framework that treats simulator construction asinstance optimization over code within a textual computation graph. Specialized LLM-driven agents are embedded as graph nodes, and a workflow manager executes a loss-driven loop: code synthesis -> execution -> evaluation -> code repair. The optimizer performs Textual-Gradient Descent (TGD), while human-in-the-loop interaction is reserved for task-spec confirmation, minimizing expert effort and keeping the code itself as the trainable object. Across three CPS tasks, i.e., User Modeling, Mask Adoption, and Personal Mobility, SOCIA-$\nabla$ attains state-of-the-art overall accuracy. By unifying multi-agent orchestration with a loss-aligned optimization view, SOCIA-$\nabla$ converts brittle prompt pipelines into reproducible, constraint-aware simulator code generation that scales across domains and simulation granularities. We will release the code soon.

cs.AI

Enhancing Conversational Agents with Theory of Mind: Aligning Beliefs, Desires, and Intentions for Human-Like Interaction

Natural language interaction with agentic Artificial Intelligence (AI), driven by Large Language Models (LLMs), is expected to remain a dominant paradigm in the near future. While humans instinctively align their communication with mental states -- an ability known as Theory of Mind (ToM), current LLM powered systems exhibit significant limitations in this regard. This study examines the extent to which open source language models (LLaMA) can capture and preserve ToM related information and how effectively it contributes to consistent ToM reasoning in generated responses. We further investigate whether explicit manipulation of ToM related components, such as beliefs, desires, and intentions, can enhance response alignment. Experiments on two LLaMA 3 variants demonstrate that incorporating ToM informed alignment improves response quality, achieving win rates of 67 and 63 percent for the 3B and 8B models, respectively. These findings highlight the potential of ToM driven strategies to improve alignment in LLM based conversational agents.

cs.CL

Enhancing Predictive Accuracy in Pharmaceutical Sales Through An Ensemble Kernel Gaussian Process Regression Approach

This research employs Gaussian Process Regression (GPR) with an ensemble kernel, integrating Exponential Squared, Revised Mat\'ern, and Rational Quadratic kernels to analyze pharmaceutical sales data. Bayesian optimization was used to identify optimal kernel weights: 0.76 for Exponential Squared, 0.21 for Revised Mat\'ern, and 0.13 for Rational Quadratic. The ensemble kernel demonstrated superior performance in predictive accuracy, achieving an \( R^2 \) score near 1.0, and significantly lower values in Mean Squared Error (MSE), Mean Absolute Error (MAE), and Root Mean Squared Error (RMSE). These findings highlight the efficacy of ensemble kernels in GPR for predictive analytics in complex pharmaceutical sales datasets.

cs.LG

Strategic Storage Investment in Electricity Markets

Arbitrage is one important revenue source for energy storage in electricity markets. However, a large amount of storage in the market will impact the energy price and reduce potential revenues. This can lead to strategic behaviors of profit-seeking storage investors. To study the investors' strategic storage investments, we formulate a non-cooperative game between competing investors. Each investor decides the storage investment over a long investment horizon, and operates the storage for arbitrage revenues in the daily electricity market. Different investors can deploy storage with different characteristics. Their decisions are coupled due to the market price that is determined by all the investors' decisions. We use market data from California ISO to characterize the storage impact on the market price, based on which we establish a centralized optimization problem to compute the market equilibrium. We show that an increasing number of investors will increase the market competition, which reduces investors' profits but increases the total invested storage capacity. Furthermore, we find that a slight increase in the storage efficiency (e.g., increased charge and discharge efficiency) can significantly improve an investor's profit share in the market.

q-fin.GN

Planning low-carbon distributed power systems: Evaluating the role of energy storage

This paper introduces a mathematical formulation of energy storage systems into a generation capacity expansion framework to evaluate the role of energy storage in the decarbonization of distributed power systems. The modeling framework accounts for dynamic charging/discharging efficiencies and maximum cycling powers as well as cycle and calendar degradation of a Li-ion battery system. Results from a small-scale distributed power system indicate that incorporating the dynamic efficiencies and cycling powers of batteries in the generation planning problem does not significantly change the optimal generation portfolio, while adding substantial computational burden. In contrast, accounting for battery degradation leads to substantially different generation expansion outcomes, especially in deep decarbonization scenarios with larger energy storage capacities. Under the assumptions used in this study, it is found that battery energy storage is economically viable for 2020 only under strict carbon emission constraints. In contrast, given the projected technology advances and corresponding cost reductions, battery energy storage exhibits an attractive option to enable deep decarbonization in 2050.

eess.SY

Optimization of Electrolyte Rebalancing in Vanadium Redox Flow Batteries

This paper presents a novel algorithm to optimize energy capacity restoration of vanadium redox flow batteries (VRFBs). VRFB technologies can have their lives prolonged through a partially restoration of the lost capacity by electrolyte rebalancing. Our algorithm finds the optimal number and time of these rebalancing services to minimize the service cost, while maximizing the revenues from energy arbitrage. We show that the linearized form of this problem can be analytically solved, and that the objective function is convex. To solve the complete problem, we develop a two-step mixed integer linear programming (MILP) algorithm, which first finds the bounds for optimal number of services and then optimizes the number, and time of the services. We then present a theoretical analysis and optimization results for a case study of energy arbitrage in New York ISO.

eess.SY

Evaluation of Energy- and Capacity-Market Revenues from Lithium-ion Battery Systems for Offshore Wind Using Advanced Battery Models

Revenue potential from offshore wind and energy storage systems for a Long Island node in the New York ISO (NYISO) is examined using advanced lithium-ion battery representations. These advanced mixed-integer-linear battery models account for the dynamic performance, as well as the degradation behavior of the batteries, which are usually not accounted for in power systems models. Multiple hybrid offshore wind and battery system designs are investigated to examine the impact of locating the battery offshore versus locating it onshore. For the examined systems, we explore different battery usable state-of-charge (SOC) windows, and corresponding dispatch of the battery to maximize energy- and capacity-market revenues. The impacts of variability of offshore wind output along with energy- and capacity-market prices are evaluated using publicly available data from 2010 to 2013. Locating the battery onshore resulted in higher revenues. For 2013, results highlight that without accurate battery representations, models can overestimate battery revenues by up to 155%, resulting primarily from degradation-related costs. Using advanced algorithms, net revenue can be increased by 29%. Results also indicate that wider useable SOC windows could lead to higher net revenues from the energy market, due to higher arbitrage opportunities that compensate for any additional degradation-tied costs in higher DODs. The added value of a MWh of energy storage varies from $2 to $3.5 per MWh of wind energy, which leads to a breakeven cost range of $50-$95 per kWh for the battery systems studied. As such, energy- and capacity-market revenues were found to be insufficient in recovering the investment costs of current battery systems for the applications considered in this analysis.

eess.SY

Power System Decarbonization: Impacts of Energy Storage Duration and Interannual Renewables Variability

Decarbonization of the electricity sector is one of the major measures in slowing down the pace of climate change. In this paper, we analyze the impacts of energy storage systems (ESS) and interannual uncertainty of variable renewable energy (VRE) on power system decarbonization in 2050. We perform capacity expansion optimization based on technology cost projections and CO2 emission restrictions using 11 years of VRE and load data in Italy's power system, with a particular focus on the role of ESS and its duration. We also explore capacity expansion optimization based on multiple-year vs. single-year data to quantify the impact of VRE interannual variability. Our results indicate high renewables penetration even in the absence of decarbonization policies. In the transition to zero carbon system, CCS plays a minor role due to its carbon capture efficiency. ESS investments contribute to lower system costs by replacing more expensive flexibility resources. However, longer ESS durations have lower marginal value per added kWh ESS. Interannual variability of VRE substantially changes the system's configuration and energy cost. Decision-making based on single-year data substantially increases the systems' operational costs in other years. In contrast, optimizing over multiple years provides a more robust and cost effective generation expansion strategy.

eess.SY

Hierarchical Bayesian Model for Probabilistic Analysis of Electric Vehicle Battery Degradation

This paper proposes a hierarchical Bayesian model for probabilistic estimation of the electric vehicle battery capacity fade. Since the battery aging factors such as temperature, current, and state of charge are not fixed, and they change in different times, locations and by the different users, deterministic models with constant parameters cannot accurately evaluate the battery capacity fade. Therefore, a probabilistic presentation of the capacity fade including uncertainties of the measurements or observations of the variables can be a proper solution. We have developed a hierarchical Bayesian Network model for the electric vehicle battery capacity fade considering multiple external variables. The mathematical expression of the model is extracted based on Bayes theorem, the probability distributions for all variables and their dependencies are carefully chosen where the Metropolis Hastings Markov Chain Monte Carlo sampling method is applied to generate the posterior distributions. The model is trained with 85 percent of experimental data to obtain its unseen parameters and tested with other 15 percent of data to prove its accuracy. Also, three case studies for different drivers, different grid services frequencies, and different climates are explored to show model flexibility with different input data. The developed model needs training data for parameter tuning in different conditions. However, after training, it has more than 95 percent precision in estimating the battery capacity fade percentage.

eess.SY

On Mechanical Behavior of Elastomeric Networks: Effects of Random Porous Microstructure

An assumption in micromechanical analysis of polymers is that the constitutive polymeric media is non-porous. Non-porosity of media, however, is merely a simplifying assumption. In this paper, we neglect this assumption and studied polymer networks with a different porosity volume fraction. A random morphology description function is used to model the porosity of the network and nonlinear finite element analyses are conducted to perform structural analysis of porous polymer networks. The results show that the porosity effect is significant in mechanical behavior of polymer networks and may increase the maximum Von-Mises stress drastically.

cond-mat.soft

CFD investigation of thermal performance of aluminum oxide nanofluid in channel

This paper shows the CFD investigation of pressure drop and thermal performance of aluminum oxide nano fluid inside square channel inserted a cylinder with and without fin using two-phase method. The constant heat flux on outer wall and laminar flow regime are applied in the considered domain using finite volume method. The results depict that the enhance of nano-particles volume concentration and Reynolds number have dramatic effects on heat transfer coefficient enhancement. Moreover, the increase of nano-particle diameter has opposite impact on heat transfer efficiency. The passive way leads to higher pressure drops. For all fluids under consideration, pressure drop escalated with Reynolds number. Injecting nano-particles into the water causes to increase in pressure drop and this impact is more significant in high nano-particle volume fraction.

physics.app-ph

Generalized Quaternion and Rotation in 3-space E (3-alfa,beta)

The paper explains how a unit generalized quaternion is used to represent a rotation of a vector in 3-dimensional space. We review of some algebraic properties of generalized quaternions and operations between them and then show their relation with the rotation matrix.

math-ph

Spherical Cyclic Motions in Euclidean Space E3

By considering a spatial curve in a Euclidean space, we use its components, together with attaining a cyclic matrix, to show that this matrix is homothetic too and is in correspondence with a homothetic motion. Furthermore, if the curve lies on a unit sphere, then the motion is a spherical cyclic motion.

math-ph

Computation of Partially Invariant Solutions for the Einstein Walker Manifolds' Identifying Equations

In this paper, partially invariant solutions (PISs) method is applied in order to obtain new four-dimensional Einstein Walker manifolds. This method is based on subgroup classification for the symmetry group of partial differential equations (PDEs) and can be regarded as the generalization of the similarity reduction method. For this purpose, those cases of PISs which have the defect structure delta=1 and are resulted from two-dimensional subalgebras are considered in the present paper. Also it is shown that the obtained PISs are distinct from the invariant solutions that obtained by similarity reduction method.

math.DG