Sin2pi's picture
Update README.md
ae7c3ed verified
metadata
license: apache-2.0
base_model:
  - openai/whisper-large-v3-turbo
pipeline_tag: automatic-speech-recognition
tags:
  - custom
  - whisper
  - echo
  - rotary
  - givens
  - learned
  - dynamic
  - meta-learning
  - Multi-Dimensional Adaptation
  - self-tuning

Quote from some AI model: "The concept of making the adaptation factor itself adaptive opens up a fascinating research direction. Imagine a model that doesn't just learn, but learns how to learn - continuously calibrating its own learning dynamics."

Self-Adjusting Parameters: The model dynamically adjusts the base parameter in response to training loss, optimizing positional embeddings in real-time. This adaptive mechanism enhances the model's ability to fine-tune itself during training, ensuring better performance and efficiency.

Combined Rotary, Orthogonally Initialized, and Givens Rotation Matrices: This component integrates rotary embeddings, an orthogonally initialized rotation matrix, and Givens rotation matrices. This robust combination provides stable and effective positional embeddings, enhancing the model's capacity to represent positional information accurately. The integration helps capture dependencies and relationships within the feature space through rotational symmetry.

Learned Sinusoidal Embeddings with Checkpointing: This unique integration of sinusoidal embeddings with optional checkpointing helps manage memory efficiently during training while maintaining stable embedding magnitudes through L2 normalization.

Dynamic Positional Bias: Supports rotary embeddings and includes relative positional bias, capturing dependencies effectively. The attention mechanism is finely tuned with a dynamically adjustable base parameter, providing flexibility and precision automatically during training.

Combining Local and Global Attention: This component leverages both local and global attention mechanisms, ensuring that the model captures both fine-grained and broad context. The sliding window approach for local attention enhances its ability to process long sequences efficiently.

Integrating Convolution and Attention: This component enriches feature representation by combining convolutional layers with attention mechanisms, enabling the model to extract local context while attending to global information simultaneously.


Rotation Block Output

The transformation applied to the tensor using the Combined Rotary Embedding, Givens Rotation Matrix, and Rotary Orthogonal Matrix is summarized by the following equation:

xtransformed=x(k=1NGk)R \mathbf{x}_{\text{transformed}} = \mathbf{x} \cdot \left( \prod_{k=1}^{N} G_k \right) \cdot R


Performance Improvements

Applying these transformations to a tensor can improve the model's performance in several ways:

  1. Rotational Symmetry: These transformations exploit rotational symmetry in the feature space, which can help the model recognize patterns and relationships that are invariant to rotations. This is particularly useful in tasks where rotation invariance is important, such as image and signal processing, as well as natural language processing where word order may vary.

  2. Enhanced Representational Power: By introducing rotations, the model can create more complex and nuanced feature representations. This allows the model to capture richer and more detailed information from the input data, leading to better performance on tasks like classification, regression, and generation.

  3. Dimensional Decorrelation: Applying orthogonal transformations helps in decorrelating the dimensions of the feature space. This can reduce redundancy and improve the efficiency of the learned representations, making the model more robust and less prone to overfitting.

  4. Stable Training: Orthogonal matrices preserve the Euclidean norm of the vectors they transform, which can help in maintaining numerical stability during training. This is beneficial for gradient-based optimization algorithms, as it prevents gradients from exploding or vanishing.

  5. Efficient Computations: Using Givens rotations allows for efficient computation of rotations in high-dimensional spaces. This can lead to faster training times and reduced computational complexity compared to other methods of achieving similar transformations.

Overall, these transformations can help in enhancing the model's ability to learn meaningful patterns from the data, resulting in improved performance and generalization on a variety of tasks.


Hugging face whisper config parameters can be ignored and are there for compatibility model should be loaded with initialization of model code for now. Model is not trained and is "medium".

config = WhisperConfig (

n_mels=80,
n_audio_ctx=1500,
n_audio_state=1024,
n_audio_head=16,
n_audio_layer=24,
vocab_size=51865,
n_text_ctx=448,
n_text_state=1024,
n_text_head=16,
n_text_layer=20,
max_rel_dist=15,
cross_attention=True,
checkpointing=True,
base=10000,
bos_token_id = 50257,
eos_token_id = 50257,
pad_token_id = 50257,
decoder_start_token_id = 50258,
is_encoder_decoder = True,
init_std=0.02,
)

model = Echo(config).to(device)

model.apply_initialization()

model.save_pretrained("./models/echo2")

model = Echo.from_pretrained("./models/echo2")

######### Roadmap--

Dynamically Adjusted Base: -- The base parameter, which affects the frequencies used in positional encodings, will dynamically adjust based on the model’s performance during training. This can lead to better capture of positional information, especially if the data characteristics vary over time. done

Responsive Hyperparameter Auto-Tuning: -- The model will continuously fine-tune itself in response to the loss observed during training. This means it can potentially learn more effectively by automatically adjusting the positional encoding's influence on learning. done for base frequency - rope embeddings. done

Proactive Adjustments: -- Just like learning rate schedulers, adjusting base based on performance can help in avoiding overfitting or underfitting, and ensure the model remains effective across different training phases. done--

Next for responsive tuning:
    Multi-Dimensional Adaptation --

  Track adaptation not just for base frequency, but for:
    - Rotation matrices
    - Attention span
    - Embedding dimensionality
    - Dropout rates
    - ??

Conceptual Question:--
- How do you measure "homeostasis" in a neural network?
  -- Create a "learning dynamics" module that observes and adjusts multiple model parameters simultaneously.?

--Learnable Frequencies and Phases: Introduce learnable frequencies and phase shifts in rotary embeddings to allow the model to adapt positional encodings dynamically. done

--Learnable Positional Scaling: Add a learnable scaling factor for positional embeddings to adjust the emphasis on positional information during training. done

--Multiple Rotation Matrices per Head: Use separate rotation matrices for each attention head to increase expressiveness and capture diverse positional patterns. wip

--Orthogonal Parameterization with Givens Rotations: Parameterize the rotation matrix using Givens rotations to enforce orthogonality without explicit re-orthogonalization. done

--Per-Layer Rotation Matrices: Implement different rotation matrices for each layer of the model to enhance representational capacity. wip

--Conditional Rotation Matrices: Generate rotation matrices conditioned on the input using a small neural network for dynamic positional relationships. wip

--Multi-Scale Rotary Embeddings: Use multiple sets of inverse frequencies to capture positional information at various scales within the same model. done

--Relative Positional Biases: Incorporate learnable relative positional biases into the attention scores to enhance positional understanding.done

--Regularization for Rotation Matrix: Add a regularization term to the loss function to encourage the rotation matrix to remain orthogonal during training. done

Anyone who has any new ideas, old ideas rehashed, bad ideas reimagined, even just bad ideas.. Send me a message.