Case Study

Analysis of Rotational Transformation Properties

An AI developer is implementing a positional embedding layer. They need to apply a 2D rotation to vector components, but it is critical that the transformation does not change the vector's length (magnitude), as this would distort the information encoded in the embedding. They are considering two potential transformation functions for a vector x=[x1x2]x = \begin{bmatrix} x_1 & x_2 \end{bmatrix} and an angle θ\theta:

  • Function A: y=[cosθx1sinθx2sinθx1+cosθx2]y = \begin{bmatrix} \cos \theta \cdot x_1 - \sin \theta \cdot x_2 & \sin \theta \cdot x_1 + \cos \theta \cdot x_2 \end{bmatrix}
  • Function B: y=[cosθx1+sinθx2sinθx1+cosθx2]y = \begin{bmatrix} \cos \theta \cdot x_1 + \sin \theta \cdot x_2 & \sin \theta \cdot x_1 + \cos \theta \cdot x_2 \end{bmatrix}

Analyze both functions. Which function should the developer choose to ensure the vector's magnitude is preserved after the transformation? Justify your answer by explaining why the chosen function works and the other one fails.

0

1

Updated 2025-10-08

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Analysis in Bloom's Taxonomy

Cognitive Psychology

Psychology

Social Science

Empirical Science

Science