---
title: 'CLIFF: Continual Learning for Flake Layers'
url: https://www.emergentmind.com/topics/continual-learning-framework-for-flake-layer-classification-cliff
type: topic
---

# CLIFF: Continual Learning for Flake Layers

Searching arXiv for the CLIFF paper and closely related continual-learning frameworks to ground the article in current literature.
Continual-Learning Framework for Flake Layer Classification (CLIFF) is a material-incremental continual-learning system for automated layer-count identification of exfoliated two-dimensional material flakes from optical microscope images. It is designed for the setting in which materials arrive sequentially, labels are scarce, and naive sequential fine-tuning causes severe catastrophic forgetting. In CLIFF, a ViT-B/16 backbone \(f_\theta\) and a linear base head \(g_\phi\) are trained on a reference material and then frozen; each subsequent material is incorporated through a material-specific prompt, a learned material embedding, and a delta head that adds residual corrections to the frozen base logits. A prompt pool, a cosine-similarity gate, memory replay, and knowledge distillation complete the framework, yielding task-agnostic inference over all seen materials and thickness categories [2508.17261].

## 1. Problem setting and scope

CLIFF addresses automated identification of the layer count of exfoliated 2D material flakes from optical microscope images. The classification targets are three shared thickness categories: **Few**, **Mono**, and **Thick**. The difficulty is not merely visual classification at fixed conditions; it is the combination of fine-grained thickness discrimination with substantial appearance shifts across materials and imaging setups. The description emphasizes that different materials have distinct optical responses, that illumination spectrum, intensity, substrate thickness, and camera response alter observed contrast and color, and that flakes themselves vary in shape, size, background noise, and contamination [2508.17261].

The continual-learning formulation is **material-incremental**. Tasks are defined by materials, with \(T1=\) BN, \(T2=\) graphene, \(T3=\) MoS\(_2\), and \(T4=\) WTe\(_2\). At base stage, the model has access to a reference-material dataset \(D_0\); later, for each new material \(m\), it receives only that material’s dataset \(D_m\). The objective is to retain performance on all previously seen materials without retraining on the full historical data. This makes CLIFF closer to a domain-shifted continual classifier than to a static per-material predictor, because the layer classes are shared while the appearance of those classes is material-dependent [2508.17261].

The paper presents this formulation as, to its knowledge, the first systematic study of continual learning in the domain of two-dimensional materials. A central implication is that forgetting must be handled not only at the class level, but also at the level of material-specific optical mappings: a monolayer is always a monolayer conceptually, yet its RGB manifestation differs across BN, graphene, MoS\(_2\), and WTe\(_2\) [2508.17261].

## 2. Core architecture

CLIFF begins with a reference-material training stage. Given
\[
D_0 = \{(x_i, y_i)\}_{i=1}^{N_0},
\]
the backbone \(f_\theta\) and base head \(g_\phi\) are optimized with
\[
\mathcal{L}_{\text{base}} = \frac{1}{N_0}\sum_{i=1}^{N_0} \mathrm{CE}\!\big(g_{\phi}(f_{\theta}(x_i)),\,y_i\big).
\]
After this stage, both \(f_\theta\) and \(g_\phi\) are frozen for all later materials [2508.17261].

For each new material \(m\), CLIFF adds three learnable components: a prompt \(P_m\), a material embedding \(e_m\), and a delta head \(D_m\). The prompted backbone feature is
\[
z_m = f_{\theta}(x; P_m),
\]
where \(P_m\) is prepended to the ViT input sequence. Each delta head receives a concatenation of the prompted feature and a material embedding:
\[
\Delta_i(x) = D_i\!\big(\mathrm{Concat}[z_m,\, e_i]\big).
\]
The delta head is therefore a material-conditioned residual mapping from frozen backbone features to thickness logits [2508.17261].

The final output is formed by concatenating corrected logits for all materials seen so far:
\[
L(x) = \mathrm{Concat}_{i=1}^M \big( b(x) + \Delta_i(x) \big) \in \mathbb{R}^{CM},
\]
where \(b(x)=g_\phi(f_\theta(x))\) and \(C=3\). Prediction is obtained by a global argmax over this \(CM\)-dimensional vector, so CLIFF does not require material labels at test time. This is an important architectural property: although training is organized by material-defined tasks, inference is task-agnostic in the sense that material identity is not provided externally [2508.17261].

The prompt mechanism is organized as a **prompt pool**. Each arriving material contributes a new prompt \(P_m\); during training on material \(m\), the new prompt and other \(m\)-specific components are updated, while prompts for past materials are frozen. The paper contrasts this with shared-pool prompt selection in Learning-to-Prompt (L2P): CLIFF uses material-specific prompts and embeddings to preserve stronger disentanglement among materials [2508.17261].

## 3. Gating, residual correction, and optimization

The cosine-similarity gate is introduced to modulate features and improve material identification. The description states that an auxiliary gate loss \(\mathcal{L}_{\text{gate}}\) is computed using cosine similarity between features and material embeddings. The role of the gate is therefore twofold: it provides a material-discriminative signal in embedding space and supports the material-specific corrections generated by the delta heads. Because the excerpt does not print a full gate equation, the architectural emphasis is on function rather than exact parameterization [2508.17261].

During the continual stage, the backbone and base head remain frozen. Training focuses on the prompt \(P_m\), embedding \(e_m\), delta head \(D_m\), and related gating components. The total loss is
\[
\mathcal{L} =
\mathcal{L}_{\text{cls}}
+ \lambda_{\text{gate}} \mathcal{L}_{\text{gate}}
+ \lambda_{\text{mem}} \mathcal{L}_{\text{mem}}
+ \lambda_{\text{kd}} \mathcal{L}_{\text{kd}}.
\]
Here, \(\mathcal{L}_{\text{cls}}\) is the classification loss on current material data, \(\mathcal{L}_{\text{mem}}\) is the replay loss on a memory buffer \(\mathcal{M}\), and \(\mathcal{L}_{\text{kd}}\) aligns current outputs with those of a frozen teacher snapshot from the previous task on replayed samples [2508.17261].

The memory buffer stores a small number of samples from previous tasks, and batches during training on material \(m\) mix new material samples with replayed samples. The teacher-student mechanism is explicitly task-sequential: the teacher is the CLIFF snapshot obtained after the previous material, and the student is the current model being trained on the next material. This combination of architectural separation and rehearsal-based stabilization is central to CLIFF’s operation. A common simplification would be to regard CLIFF as a prompt-only method; that is inaccurate. The method uses prompts, but it also uses material embeddings, delta heads, memory replay, and knowledge distillation [2508.17261].

## 4. Empirical behavior

CLIFF is evaluated on optical microscopy data containing hBN, graphene, MoS\(_2\), and WTe\(_2\), with hBN used as the reference material. The reported baselines are **Joint Training**, **Naive Fine-tuning**, and **L2P**. Joint training serves as an upper bound because all materials are trained simultaneously and no continual-learning constraint is imposed [2508.17261].

| Method | Avg. Accuracy | Forgetting |
|---|---:|---:|
| Joint Training | 92.11% | — |
| Naive Fine-tuning | 17.85% | 84.20% |
| L2P | 36.99% | 59.73% |
| CLIFF | 56.96% | 34.80% |

The trajectory details clarify the nature of forgetting. Under naive fine-tuning, \(T1\) drops from \(91.46\%\) after the first task to \(4.88\%\) after all four tasks, and \(T3\) drops from \(83.77\%\) to \(0.65\%\). L2P improves over naive fine-tuning but still exhibits substantial degradation: after \(T4\), its task accuracies are \(53.66\%\) on \(T1\), \(21.23\%\) on \(T2\), \(1.30\%\) on \(T3\), and \(71.77\%\) on \(T4\). CLIFF retains markedly more performance on earlier materials while remaining competitive on the newest one: after \(T4\), it reports \(56.10\%\) on \(T1\), \(44.79\%\) on \(T2\), \(44.16\%\) on \(T3\), and \(82.78\%\) on \(T4\) [2508.17261].

The qualitative interpretation given in the paper is that CLIFF’s material-specific delta heads and embeddings keep optical-domain corrections separated, while the frozen backbone and base head preserve a stable reference representation. This suggests that the method is not merely reducing interference statistically; it is also structuring the interference so that new materials are added as residual deviations from a common BN-trained reference rather than by overwriting a single shared classifier [2508.17261].

## 5. Position within continual-learning research

CLIFF belongs to a broader family of continual-learning methods that trade off shared representation, task-specific adaptation, and explicit anti-forgetting mechanisms. In relation to other 2024–2025 frameworks, its design is notable for combining a frozen pretrained core with lightweight per-task residual modules and replay-based preservation [2508.17261].

A useful contrast is the two-branch **Generalizable Two-Branch (G2B)** framework, where the output of each main-branch block is multiplicatively modulated by a soft mask generated by a lightweight side-branch CNN, while the main continual-learning model itself remains architecturally unchanged [2402.18086]. Another contrast is the **Pairwise Interaction Layer** approach, which replaces the final layer with a sparse pairwise correlation layer combined with k-WTA and streaming Adagrad or S-MAS in a rehearsal-free, task-agnostic setting without task labels or boundaries [2405.13632]. CLIFF does not follow either pattern. It freezes a base ViT and classifier, uses prompts to alter token processing, conditions residual logits on material embeddings, and relies on replay and distillation rather than a purely architectural or purely optimizer-level solution [2508.17261].

From a unification standpoint, contemporary work has described continual learning through shared optimization primitives—cross-entropy on current data plus output-space and weight-space regularization, often expressed with Bregman divergences and sometimes enhanced with refresh learning [2403.13249]. CLIFF can be read within that broader taxonomy as a method that combines architectural specialization with memory replay and teacher-based output preservation. A plausible implication is that its components are modular: replay and distillation provide generic CL stabilization, while prompts and delta heads encode the particular structure of material-incremental optical microscopy [2508.17261].

## 6. Limitations, misconceptions, and future directions

The paper identifies two direct limitations. First, CLIFF depends on a memory buffer, and the reported retention improvements are explicitly tied to replay; larger buffers improve retention but increase storage overhead. Second, the method treats each material as a distinct task and does not explicitly exploit similarities among optically related materials. As the number of materials grows, the number of embeddings and delta heads grows linearly, so scalability to very large material libraries remains an open issue [2508.17261].

Several misconceptions are addressed by the architecture itself. CLIFF is not a fully shared continual learner: the backbone and base head are frozen after reference-material training. Nor is it a purely task-conditioned test-time system: despite being trained with material-defined tasks, it performs task-agnostic inference by taking a global argmax over all material-thickness logits. Finally, it is not equivalent to generic prompt tuning. The prompt pool is only one component; the material embeddings, cosine-similarity gate, delta heads, replay buffer, and distillation term are all integral to the method [2508.17261].

The future directions named in the paper focus on transferring knowledge between optically similar materials, for example through subspace clustering of material embeddings, shared delta heads for groups of similar materials, or regularization that keeps embeddings of similar materials close. Extensions to additional microscopy modalities, flake segmentation, and integration with automated experimental workflows are also identified. This suggests that CLIFF is best understood not as a finished universal solution, but as a domain-specific continual-learning template in which frozen shared structure and material-specific residual adaptation are jointly used to manage catastrophic forgetting in 2D-material identification [2508.17261].

Source: https://www.emergentmind.com/topics/continual-learning-framework-for-flake-layer-classification-cliff