Skip to main content
QUICK REVIEW

[Paper Review] Positional Encodings for Light Curve Transformers: Playing with Positions and Attention

Daniel Moreno-Cartagena, G. Cabrera-Vives|arXiv (Cornell University)|Aug 11, 2023
Advanced Vision and ImagingComputer Science3 citations
TL;DR

This paper proposes a trainable positional encoding (PE) for light curve transformers that improves performance and training efficiency by incorporating temporal information directly into the final attention layer output. The method outperforms fixed, non-trainable PEs in classification accuracy and convergence speed across diverse datasets with varying cadences and magnitude distributions.

ABSTRACT

We conducted empirical experiments to assess the transferability of a light curve transformer to datasets with different cadences and magnitude distributions using various positional encodings (PEs). We proposed a new approach to incorporate the temporal information directly to the output of the last attention layer. Our results indicated that using trainable PEs lead to significant improvements in the transformer performances and training times. Our proposed PE on attention can be trained faster than the traditional non-trainable PE transformer while achieving competitive results when transfered to other datasets.

Motivation & Objective

  • To evaluate the transferability of light curve transformers across datasets with different cadences and magnitude distributions.
  • To investigate the impact of various positional encoding (PE) strategies on transformer performance in time series classification.
  • To improve model generalization by separating temporal and observational information in the attention mechanism.
  • To accelerate training while maintaining or improving classification accuracy through learnable PEs.
  • To propose a novel method of injecting temporal information directly into the output of the last attention layer.

Proposed method

  • Proposes a trainable positional encoding (PE) that replaces the fixed sine-cosine functions used in standard transformers.
  • Introduces a new method to inject temporal information directly into the output of the final attention layer, decoupling it from the input embedding.
  • Employs a feed-forward network (FFN) to process observational magnitudes, followed by addition or concatenation with the PE.
  • Uses a modified sinusoidal PE as a baseline, with frequencies scaled by a base frequency of 1000 and dimension-dependent decay.
  • Applies multi-head self-attention with query, key, and value projections, followed by residual connections and layer normalization.
  • Evaluates multiple PEs: trainable, Fourier-based, recurrent, Tupe-A, PEA, and Concat PE, comparing performance and training time.

Experimental results

Research questions

  • RQ1How do different positional encoding strategies affect the performance of light curve transformers on datasets with varying cadences?
  • RQ2Can a trainable positional encoding improve generalization and reduce training time compared to fixed, non-trainable PEs?
  • RQ3Does separating temporal and observational information via concatenation (Concat PE) lead to better classification performance?
  • RQ4How does the proposed method of injecting temporal information into the final attention layer output compare to standard PE injection?
  • RQ5What is the transferability of a light curve transformer with different PEs across datasets with different magnitude distributions (e.g., OGLE, ATLAS)?

Key findings

  • The trainable PE achieved the best overall performance in terms of F1-score and training speed, outperforming the baseline across all cadences and datasets.
  • The Fourier PE showed the best reconstruction performance and fastest training time during pretraining, outperforming the baseline in both metrics.
  • The Concat PE achieved the highest average F1-score across all datasets by effectively separating observational and temporal features.
  • The PEA (Positional Encoding Attention) method trained faster than the baseline and achieved the best classification results among the three fastest models (Recurrent, Tupe-A, PEA), particularly on MACHO datasets.
  • The trainable PE showed the least degradation in performance on sparser light curves (1/2 and 1/4 cadences), indicating superior robustness to irregular sampling.
  • The Fourier PE outperformed the baseline in both OGLE and ATLAS surveys, achieving the best F1-score on ATLAS, while the trainable PE matched or exceeded it on OGLE.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.