Nearest Neighbor Methods
Capturing Symmetry and Antisymmetry in Language Models through Symmetry-Aware Training Objectives
Yuan, Zhangdie, Vlachos, Andreas
Capturing symmetric (e.g., country borders another country) and antisymmetric (e.g., parent_of) relations is crucial for a variety of applications. This paper tackles this challenge by introducing a novel Wikidata-derived natural language inference dataset designed to evaluate large language models (LLMs). Our findings reveal that LLMs perform comparably to random chance on this benchmark, highlighting a gap in relational understanding. To address this, we explore encoder retraining via contrastive learning with k-nearest neighbors. The retrained encoder matches the performance of fine-tuned classification heads while offering additional benefits, including greater efficiency in few-shot learning and improved mitigation of catastrophic forgetting.
LayerFlow: Layer-wise Exploration of LLM Embeddings using Uncertainty-aware Interlinked Projections
Sevastjanova, Rita, Gerling, Robin, Spinner, Thilo, El-Assady, Mennatallah
Figure 1: LayerFlow supports the analysis of contextual word embedding properties. T o increase the awareness of the potential uncertainty within the transformation, representation, and interpretation steps of the used processing pipeline, we utilize multiple visual components such as cluster convex-hulls, pairwise distances, cluster summaries, projection quality metrics, and connections of k-nearest neighbors.Abstract Large language models (LLMs) represent words through contextual word embeddings encoding different language properties like semantics and syntax. Understanding these properties is crucial, especially for researchers investigating language model capabilities, employing embeddings for tasks related to text similarity, or evaluating the reasons behind token importance as measured through attribution methods. Applications for embedding exploration frequently involve dimensionality reduction techniques, which reduce high-dimensional vectors to two dimensions used as coordinates in a scatterplot. This data transformation step introduces uncertainty that can be propagated to the visual representation and influence users' interpretation of the data. T o communicate such uncertainties, we present LayerFlow - a visual analytics workspace that displays embeddings in an interlinked projection design and communicates the transformation, representation, and interpretation uncertainty. In particular, to hint at potential data distortions and uncertainties, the workspace includes several visual components, such as convex hulls showing 2D and HD clusters, data point pairwise distances, cluster summaries, and projection quality metrics. W e show the usability of the presented workspace through replication and expert case studies that highlight the need to communicate uncertainty through multiple visual components and different data perspectives. CCS Concepts Human-centered computing Visual analytics; Mathematics of computing Dimensionality reduction;1 Introduction In recent years, a large number of deep-learning-based language models (e.g., BERT [DCL T19]) have emerged, demonstrating remarkable performance in natural language processing (NLP) and understanding tasks. These models learn from large text datasets, acquiring language structures in an unsupervised manner. Thereby, they produce contextual word embeddings, representing words through vectors encoding different language properties. Extensive research has been conducted to understand the linguistic properties embedded in these vectors. For instance, research indicates that BERT's middle layers capture syntactic features like dependency trees while early layers encode lexical features [RKR20]. Analyzing these properties helps researchers better understand how language models process data and aids in developing models that generalize well, reducing biases and improving inclusivity.
Adaptive Locally Linear Embedding
Goli, Ali, Alizadeh, Mahdieh, Yazdi, Hadi Sadoghi
Ali Goli 1, Mahdieh Alizadeh 1, and Hadi Sadoghi Yazdi 1,2 1 Department of Computer Engineering, Ferdowsi University of Mashhad, Mashhad, Iran 2 Center of Excellence in Soft Computing and Intelligent Information Processing, Ferdowsi University of Mashhad, Mashhad, Iran April 10, 2025 Abstract Manifold learning techniques, such as Locally linear embedding (LLE), are designed to preserve the local neighborhood structures of high-dimensional data during dimensionality reduction. Traditional LLE employs Euclidean distance to define neighborhoods, which can struggle to capture the intrinsic geometric relationships within complex data. A novel approach, Adaptive locally linear embedding(ALLE), is introduced to address this limitation by incorporating a dynamic, data-driven metric that enhances topological preservation. This method redefines the concept of proximity by focusing on topological neighborhood inclusion rather than fixed distances. By adapting the metric based on the local structure of the data, it achieves superior neighborhood preservation, particularly for datasets with complex geometries and high-dimensional structures. Experimental results demonstrate that ALLE significantly improves the alignment between neighborhoods in the input and feature spaces, resulting in more accurate and topologically faithful embeddings. Keywords-- Manifold Learning, Adaptive Locally Linear Embedding, Dimensionality Reduction, Topological Preservation, Complex Geometries, High-Dimensional Data, Topological Neighborhood Inclusion, Intrinsic Geometric Relationships 1 Introduction Locally linear embedding(LLE) is a prominent manifold learning technique designed to reduce the dimensionality of high-dimensional datasets while preserving their intrinsic geometric structure. Proposed by Roweis and Saul, LLE operates through a systematic process that includes identifying the K-nearest neighbors for each data point, calculating reconstruction weights to express each point as a linear combination of its neighbors, and ultimately generating a low-dimensional representation that retains local relationships [14]. However, LLE traditionally relies on fixed distance metrics, such as Euclidean distance, which may inadequately represent complex data distributions and fail to capture nuanced topological relationships. In response to these limitations, we introduce a novel approach termed Adaptive LLE(ALLE), which integrates a flexible, data-driven metric into the LLE framework.
Novel sparse PCA method via Runge Kutta numerical method(s) for face recognition
Tran, Loc Hoang, Nguyen, Luong Anh Tuan
Face recognition is a crucial topic in data science and biometric security, with applications spanning military, finance, and retail industries. This paper explores the implementation of sparse Principal Component Analysis (PCA) using the Proximal Gradient method (also known as ISTA) and the Runge - Kutta numerical methods. To address the face recognition problem, we integrate sparse PCA with either the k - nearest neighbor method or the kernel ridge regression method. Experimental results demonstrate that combining sparse PCA -- solved via the Proximal Gradient method or the Runge - Kutta numerical approach -- with a classification system yields higher accuracy compared to standard PCA. Additionally, we observe that the Runge - Kutta - based sparse PCA computation consistently outperforms the Proximal Gradient method in terms of speed.
Solve sparse PCA problem by employing Hamiltonian system and leapfrog method
Principal Component Analysis (PCA) is a widely utilized technique for dimensionality reduction; however, its inherent lack of interpretability-stemming from dense linear combinations of all feature-limits its applicability in many domains. In this paper, we propose a novel sparse PCA algorithm that imposes sparsity through a smooth L1 penalty and leverages a Hamiltonian formulation solved via geometric integration techniques. Specifically, we implement two distinct numerical methods-one based on the Proximal Gradient (ISTA) approach and another employing a leapfrog (fourth-order Runge-Kutta) scheme-to minimize the energy function that balances variance maximization with sparsity enforcement. To extract a subset of sparse principal components, we further incorporate a deflation technique and subsequently transform the original high-dimensional face data into a lower-dimensional feature space. Experimental evaluations on a face recognition dataset-using both k-nearest neighbor and kernel ridge regression classifiers-demonstrate that the proposed sparse PCA methods consistently achieve higher classification accuracy than conventional PCA. Future research will extend this framework to integrate sparse PCA with modern deep learning architectures for multimodal recognition tasks.
k-NN as a Simple and Effective Estimator of Transferability
Sorkhei, Moein, Matsoukas, Christos, Haslum, Johan Fredin, Smith, Kevin
How well can one expect transfer learning to work in a new setting where the domain is shifted, the task is different, and the architecture changes? Many transfer learning metrics have been proposed to answer this question. But how accurate are their predictions in a realistic new setting? We conducted an extensive evaluation involving over 42,000 experiments comparing 23 transferability metrics across 16 different datasets to assess their ability to predict transfer performance. Our findings reveal that none of the existing metrics perform well across the board. However, we find that a simple k-nearest neighbor evaluation -- as is commonly used to evaluate feature quality for self-supervision -- not only surpasses existing metrics, but also offers better computational efficiency and ease of implementation.
ML-Based Bidding Price Prediction for Pay-As-Bid Ancillary Services Markets: A Use Case in the German Control Reserve Market
Bezold, Vincent, Baur, Lukas, Sauer, Alexander
The increasing integration of renewable energy sources has led to greater volatility and unpredictability in electricity generation, posing challenges to grid stability. Ancillary service markets, such as the German control reserve market, allow industrial consumers and producers to offer flexibility in their power consumption or generation, contributing to grid stability while earning additional income. However, many participants use simple bidding strategies that may not maximize their revenues. This paper presents a methodology for forecasting bidding prices in pay-as-bid ancillary service markets, focusing on the German control reserve market. We evaluate various machine learning models, including Support Vector Regression, Decision Trees, and k-Nearest Neighbors, and compare their performance against benchmark models. To address the asymmetry in the revenue function of pay-as-bid markets, we introduce an offset adjustment technique that enhances the practical applicability of the forecasting models. Our analysis demonstrates that the proposed approach improves potential revenues by 27.43 % to 37.31 % compared to baseline models. When analyzing the relationship between the model forecasting errors and the revenue, a negative correlation is measured for three markets; according to the results, a reduction of 1 EUR/MW model price forecasting error (MAE) statistically leads to a yearly revenue increase between 483 EUR/MW and 3,631 EUR/MW. The proposed methodology enables industrial participants to optimize their bidding strategies, leading to increased earnings and contributing to the efficiency and stability of the electrical grid.
Effective Feature Selection for Predicting Spreading Factor with ML in Large LoRaWAN-based Mobile IoT Networks
Prakash, Aman, Choudhury, Nikumani, Hazarika, Anakhi, Gorrela, Alekhya
LoRaWAN is a low-power long-range protocol that enables reliable and robust communication. This paper addresses the challenge of predicting the spreading factor (SF) in LoRaWAN networks using machine learning (ML) techniques. Optimal SF allocation is crucial for optimizing data transmission in IoT-enabled mobile devices, yet it remains a challenging task due to the fluctuation in environment and network conditions. We evaluated ML model performance across a large publicly available dataset to explore the best feature across key LoRaWAN features such as RSSI, SNR, frequency, distance between end devices and gateways, and antenna height of the end device, further, we also experimented with 31 different combinations possible for 5 features. We trained and evaluated the model using k-nearest neighbors (k-NN), Decision Tree Classifier (DTC), Random Forest (RF), and Multinomial Logistic Regression (MLR) algorithms. The combination of RSSI and SNR was identified as the best feature set. The finding of this paper provides valuable information for reducing the overall cost of dataset collection for ML model training and extending the battery life of LoRaWAN devices. This work contributes to a more reliable LoRaWAN system by understanding the importance of specific feature sets for optimized SF allocation.
Bags of Projected Nearest Neighbours: Competitors to Random Forests?
In this paper we introduce a simple and intuitive adaptive k nearest neighbours classifier, and explore its utility within the context of bootstrap aggregating ("bagging"). The approach is based on finding discriminant subspaces which are computationally efficient to compute, and are motivated by enhancing the discrimination of classes through nearest neighbour classifiers. This adaptiveness promotes diversity of the individual classifiers fit across different bootstrap samples, and so further leverages the variance reducing effect of bagging. Extensive experimental results are presented documenting the strong performance of the proposed approach in comparison with Random Forest classifiers, as well as other nearest neighbours based ensembles from the literature, plus other relevant benchmarks. Code to implement the proposed approach is available in the form of an R package from https://github.com/DavidHofmeyr/BOPNN.
Machine learning algorithms to predict stroke in China based on causal inference of time series analysis
Zheng, Qizhi, Zhao, Ayang, Wang, Xinzhu, Bai, Yanhong, Wang, Zikun, Wang, Xiuying, Zeng, Xianzhang, Dong, Guanghui
Participants: This study employed a combination of Vector Autoregression (VAR) model and Graph Neural Networks (GNN) to systematically construct dynamic causal inference. Multiple classic classification algorithms were compared, including Random Forest, Logistic Regression, XGBoost, Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Gradient Boosting, and Multi Layer Perceptron (MLP). The SMOTE algorithm was used to undersample a small number of samples and employed Stratified K-fold Cross Validation. Results: This study included a total of 11,789 participants, including 6,334 females (53.73%) and 5,455 males (46.27%), with an average age of 65 years. Introduction of dynamic causal inference features has significantly improved the performance of almost all models. The area under the ROC curve of each model ranged from 0.78 to 0.83, indicating significant difference (P < 0.01). Among all the models, the Gradient Boosting model demonstrated the highest performance and stability. Model explanation and feature importance analysis generated model interpretation that illustrated significant contributors associated with risks of stroke. Conclusions and Relevance: This study proposes a stroke risk prediction method that combines dynamic causal inference with machine learning models, significantly improving prediction accuracy and revealing key health factors that affect stroke. The research results indicate that dynamic causal inference features have important value in predicting stroke risk, especially in capturing the impact of changes in health status over time on stroke risk. By further optimizing the model and introducing more variables, this study provides theoretical basis and practical guidance for future stroke prevention and intervention strategies.