# Humans and language models diverge when predicting repeating text

Aditya R. Vaidya
UT Austin
<EMAIL_ADDRESS>
&Javier Turek
Intel Labs
<EMAIL_ADDRESS>
&Alexander G. Huth
UT Austin
<EMAIL_ADDRESS>

###### Abstract

Language models that are trained on the next-word prediction task have been
shown to accurately model human behavior in word prediction and reading speed.
In contrast with these findings, we present a scenario in which the
performance of humans and LMs diverges. We collected a dataset of human next-
word predictions for five stimuli that are formed by repeating spans of text.
Human and GPT-2 LM predictions are strongly aligned in the first presentation
of a text span, but their performance quickly diverges when memory (or in-
context learning) begins to play a role. We traced the cause of this
divergence to specific attention heads in a middle layer. Adding a power-law
recency bias to these attention heads yielded a model that performs much more
similarly to humans. We hope that this scenario will spur future work in
bringing LMs closer to human behavior.111Data and code are publicly available
at: https://github.com/HuthLab/lm-repeating-text

##  1 Introduction

Transformer-based language models (LMs) are neural networks that are trained
to predict upcoming words from their preceding context. These models flexibly
retrieve and combine information across a context that might span thousands of
words, enabling them to learn from in-context examples Dai et al. (2022); Xie
et al. (2022); Olsson et al. (2022), tell coherent stories Lee et al. (2022),
and perform many other advanced language tasks Tiedemann and Thottingal
(2020); Brown et al. (2020).

These abilities far surpass any previous computational models or linguistic
theories Yang and Piantadosi (2022), leading many to use LMs as models of
human cognition. For example, LM surprisal—a measure of how well it can
predict the next word—has been found to be highly correlated with both how
long humans spend reading each word Goodkind and Bicknell (2018); Hao et al.
(2020); Wilcox et al. (2020) and the accuracy of human next-word predictions
Goldstein et al. (2021); Jacobs and McCarthy (2020). These results suggest
that LMs and humans might be using similar mechanisms to structure and recall
information from memory. However, these seeming parallels have not gone
unchallenged. Oh and Schuler (2023), for example, showed that LM surprisal and
human reading time become decorrelated as models grow in size and power,
suggesting a more superficial relationship than previously thought.

In this work we test whether apparent similarities between LM and human next-
word prediction accuracy reflect true similarities in memory mechanisms. To
accomplish this we introduce a new task that combines memory with next-word
prediction using repeating natural text stimuli. Comparing human behavioral
performance with an LM, we found that LM surprisal decorrelates from human
predictions in this scenario. While human performance improves modestly with
each repetition, the transformer-based LM GPT-2 Radford et al. (2019) reaches
near-perfect performance after just one presentation. To better understand
this behavior, we examined the patterns of memory access (via attention) in
the model, revealing how the model solves this task. We then showed that the
model can be made to perform more like the humans by adjusting these patterns
to mimic human memory Donkin and Nosofsky (2012).

This work demonstrates an important way in which human and LM memory
mechanisms diverge, casting doubt on the use of existing LMs as a model of
human cognition. However, the framework we developed for making the model more
human-like also provides a potential way forward. Directly optimizing LMs for
human-like behavior—including but not limited to memory tasks like that used
here—could lead to much better computational models of human cognition and
memory. It is also possible that investigating the relationship between human
and model memory could provide guidance for developing better, more efficient
neural network models.

Figure 1: Paradigm for collecting human next-word predictions. A span of text
is presented three times without break. Each presentation of the stimulus is
denoted with a different color. Subjects are shown words one-at-a-time with
RSVP. When prompted to predict the next word, subjects are shown the previous
10 words and are given 10 seconds to type their prediction. After submitting a
response, presentation of the stimulus resumes. If incorrect, they are first
shown the correct word and must acknowledge before continuing.

##  2 Related works

Human performance on recall tasks, like the experiment we propose here, is
primarily limited by short-term memory Baddeley (1992). In these tasks, humans
show both recency biases (i.e. better recall for the most recent items) and
primacy biases (better for the first items) Tzeng (1973); Jefferies et al.
(2004). Recall tasks often show repetition effects; presenting a stimulus
multiple times successively decreases the recall error rate Kintsch (1965);
Baddeley and Ecob (1973); Amlund et al. (1986). Some have suggested a link
between language deficits and the number of presentations needed to reach
perfect verbatim sentence recall Miles et al. (2006). Many studies have also
shown that human memory decay follows a power law Donkin and Nosofsky (2012),
where, for example, the number of items accurately recalled from a list will
decrease over time $t$ proportional to $t^{-d}$ for some constant decay rate
$d$.

Transformers neural networks, in contrast with humans, can attend to exact
token identities hundreds or thousands of tokens in the past at no additional
cost, subject only to the context length. One limitation of the standard
attention implementation is that memory and runtime scale quadratically with
the number of tokens, making longer inputs prohibitively expensive. Recently,
significant work has gone into extending the maximum context length for
transformers while avoiding these computational issues. Transformer-XL caches
hidden states to allow attention to tokens beyond the immediate input Dai et
al. (2019). FlashAttention is an optimized attention algorithm that exploits
the hardware architecture to train models with context lengths up to 64K
tokens Dao et al. (2022). The ALiBi method Press et al. (2022) replaces
sinusoidal positional embeddings with a recency bias on the attention scores,
such that closer query-key pairs are weighted higher than more distant pairs.
Using ALiBi necessitates retraining a model with the new attention mechanism,
though once trained it can generalize to longer lengths.

Figure 2: Behavioral and model results. (a) Human next-word prediction
accuracy for one stimulus. Prompted words are split into stop words and non-
stop words using the stop word list from NLTK Bird et al. (2009). Dotted
vertical lines indicate the boundaries between presentations. (b) Human and
model performance, averaged within each presentation, for three different
stimuli. Stimuli 1 and 2 were presented three times, while Stimulus 5 was
presented four times. Both model and human accuracy improve over
presentations, but model performance improves much faster and reaches a higher
level. (c) Timecourse for human (green) and model (purple) performance for the
stimulus from (a).

##  3 Human behavioral study

We first designed an experiment to evaluate human memory in a next-word
prediction task with repeated word sequences. We then compared the humans
against an LM on the same stimuli to evaluate the LM’s memory.

###  3.1 Setup for humans

We collected human next-word predictions on repeating stimuli from a corpus of
spoken story transcripts LeBel et al. (2023). To construct the stimuli, we
chose five phrase-aligned spans of between 40 and 100 words (without
punctuation) from the corpus and repeated each span between one and three
times, for a total of between 2 and 4 presentations of the span. One span was
repeated once; three spans were repeated twice; and one span was repeated
three times. The stimuli can be seen in Section A in the Appendix. Subjects
were presented words one-at-a-time via rapid serial visual presentation (RSVP;
Potter, 1984) at a fixed duration of $400\text{\,}\mathrm{ms}$ per word, with
$1.5\text{\,}\mathrm{s}$ pauses at the end of each presentation. At
predetermined moments, subjects were prompted to predict the next word given
the previous 10 words. Prompts appeared roughly every 13 words, giving the
subjects time to process the story naturally between interruptions. Figure 1
shows the presentation of the stimuli and an example prompt screen.

To ensure that we could measure memory effects robustly, 50% of a given
subject’s prompts were at the same position in all presentations of a
stimulus, while the other 50% were only prompted on a single presentation.
Within each presentation, prompts were selected by taking a weighted random
sample of the words to provide a balanced selection of low- and high-frequency
words. Weights were calculated as the average of two values: the complement of
the unigram probability and the reciprocal of the unigram probability. Both
weights were normalized to sum over words to 1 before being averaged. Subjects
were told at the beginning of the experiment that the word sequences will
repeat, but were not told where. Human performance
$P_{\text{human}}(\text{correct})$ was calculated as the proportion of
participants whose responses exactly match the ground-truth next word,
ignoring case and leading or trailing whitespace.

In total, 100 online participants were recruited through Prolific
(www.prolific.co). Subjects were required to be fluent in English and were
given performance-based bonus compensation. The online experiment was
constructed using the Gorilla Experiment Builder (www.gorilla.sc). The
experimental protocol was approved by the Institutional Review Board at The
University of Texas at Austin. Written consent was obtained from all subjects.

Figure 3: Attention patterns. (a) Attention matrices for four heads in layer 6
for Stimulus 1 (65-word span presented 3 times). Plotted is the log-attention.
Dotted gray lines indicate boundaries between presentations. Strong diagonals
demonstrating induction from previous presentations are present in heads 1 and
2, but not 3 and 4. (b) Summarized attention patterns across layers.
Probability mass of each category is averaged across all tokens, all heads for
the given layer, and all stimuli. Induction-like attention emerges sharply at
layer 6 and is present in each subsequent layer.

###  3.2 Setup for language models

We used a pre-trained GPT-2 Small Radford et al. (2019) model, which we fine-
tuned to change its tokenization from BPE Sennrich et al. (2016) to word-level
(i.e., whitespace-delimited) so that its tokenization scheme would match the
experimental protocol for the human participants. We used non-repeating story
transcripts as training data for fine-tuning and excluded the stories used to
construct the behavioral stimuli. To get model prediction probabilities for
comparison with the human data, we fed the entire repeating stimulus into the
model and calculated the top-1 accuracy for each token.

##  4 Behavioral study results

Figure 2a shows human performance on one text span; as they are shown more
words, human accuracy generally increases. Many stop words are predicted well
even during the first presentation, while non-stop words improve more linearly
with the number of presentations. Humans consistently improve as they are
shown more presentations of the same text span, as seen in Figure 2b. While
the model accuracy is similar to humans on the first presentation, it quickly
jumps to a much higher level thereafter.

A more detailed view appears in Figure 2c, where we show accuracy for both
model and human on each probe word. GPT-2 accuracy is strongly correlated with
human accuracy for the initial presentation of this span ($r=0.87$),
replicating earlier findings Goldstein et al. (2021). However, model and human
accuracies markedly diverge thereafter, with the correlation dropping to
$r=0.24$ in the second presentation and $r=0.05$ in the third.

These results provide a potent counterexample to previous claims of alignment:
Humans and LMs only seem to behave similarly in the initial presentation of a
stimulus, but produce uncorrelated behavior once short-term memory comes into
play. This suggests that the model and humans are exploiting very different
memory mechanisms to solve this task. The humans must rely on lossy short-term
memory, while the model can leverage in-context learning to provide super-
human, near-perfect recall. While earlier reports suggested that such detailed
recall might mimic human working memory Armeni et al. (2022), these results
suggest that the models go well beyond human capabilities.

##  5 Patterns in model attention

Our behavioral results show that human and LM next-word prediction diverge
sharply when short-term memory is involved, suggesting that the two systems
use substantially different memory mechanisms. To gain insight into the cause
of these differences, we next sought to understand how exactly the model was
able to achieve such high performance on this task.

“Memory” in transformer models is implemented by using dot-product attention
over previous words. Each of the 12 layers in this model contains 12 attention
heads, each of which looks for specific features in the content or location of
previous words. The action of each attention head can be summarized in an
attention matrix, $A$, which shows how much attention token $i$ is paying to
token $j$ for all $j<i$. Attention weights are normalized so that each row
$A_{i}$ of the attention matrix sums to 1. The values in the attention matrix
can thus show us how and where the model is “recalling” past information.

Previous work on simplified transformer models has identified the emergence of
specific attention heads that recognize patterns in the input and produce
outputs that complete those patterns Elhage et al. (2021); Olsson et al.
(2022). These induction heads specifically attend to the token after the
previous presentation of the current (input) token, essentially allowing the
model to read out the completion from a previous instance of the same pattern.
For inputs that are constructed from repeating sequences—like those used in
our behavioral experiment—induction heads should thus produce a highly
stereotypical attention matrix: If a stimulus consists of repeating spans of
length $k$, the head attends to the token $k-1$ tokens in the past.

We examined the attention matrices of GPT-2 Small for our stimuli and found
multiple heads across many layers that exhibit induction behavior. Figure 3a
depicts example attention matrices for four heads in layer 6. While attention
values are non-negative and sum to 1 in each row, we use log-scaled values
here to highlight subtle effects. For this test the stimulus consisted of
three presentations of a $65$-word span, so an induction head should attend to
the word appearing $64$ positions ago, which is exactly the word that the
model should output at each point. This should manifest as strong diagonals in
the attention matrix. This is exactly the pattern that we see for attention
heads 1 and 2. Further, when processing tokens in the third presentation,
these heads attend to previous instances in both of the first two
presentations ($64$ and $129$ tokens in the past). To illustrate that this
pattern is not found everywhere in the model, we also show two other attention
heads (3 and 4) from the same layer, which exhibit no induction-like behavior,
but instead attend to recent words.

To more efficiently find induction-like behavior in the model, we can
summarize how well the attention matrix for each head matches a few different
patterns. For each layer, we quantified the average probability mass
attributable to the heads attending to:

  * •

the first token in the input, often thought to represent a sort of “default”
attention state Olsson et al. (2022),

  * •

the 5 most recent tokens (likely capturing local syntactic effects),

  * •

the current token,

  * •

past instances of the current token,

  * •

the token after each past instance of the current token (induction), and

  * •

all other tokens.

Figure 3b shows the probability mass given to each attention pattern in each
layer, averaged across all 12 heads. We see that the induction attention
pattern arises sharply and specifically in layer 6 and continues through the
output layer (layer 12). These results suggest that these layers—and
especially layer 6—have a causal role in copying words from previous
repetitions of the text span, and thus may be the source of the divergence in
human-LM accuracy. In the next section, we test this hypothesis by selectively
disrupting each layer in an attempt to make the model more human-like.

Figure 4: Attention bias optimization. (a) An example bias matrix that would
give the attention head a recency bias ($\alpha_{h}=0.373,\beta_{h}=0.0049$).
(b) Example timecourse that shows human performance (green), original model
performance (purple), and post-optimization held-out model performance (pink).
Error bars indicate SEM across initializations. (c) Human and model
performance, averaged within presentations, for the same stimulus. (d) Average
training and validation curves. The validation curve is the MSE on a randomly
selected, held-out subset of the prompts of the training stimulus. Error bars
show standard error of the mean (SEM) across training stimuli and
initializations. (e) Change in mass of each attention category. (f) Change in
correlation with human predictions and LM perplexity on unseen text. After
optimization, human-model correlation increases after the first presentation
of the stimulus (brown), but slightly decreases in the initial presentation
(orange). Perplexity (blue), plotted here as the ratio of post- and pre-
optimization performance, is hurt most in the middle layers.

##  6 Attention optimization

Our previous results showed that human and LM next-word prediction accuracy
diverge when short-term memory comes into play, suggesting that human and
model memory mechanisms behave very differently. We then showed this
divergence might be caused by the model’s induction heads, which we
hypothesized enable it to identify and recall patterns with superhuman
accuracy. We next asked if it is possible to modify the model so that its
memory behaves more like the human. Because the LM is superhuman, such a
modification will selectively _hurt_ the LM’s performance.

Since memory in this model is implemented through attention, we approached
this problem by modifying the attention matrices of the model. We learn an
additive bias $B_{h}$ for the attention matrix of each head $h$ in one layer
such that adding this bias to the pre-softmax attention weights will produce
outputs that are more human-like. Namely, we modify the attention mechanism in
the model to be

$\text{Attn}(Q,K,V)=\text{softmax}\left(\frac{QK^{T}}{\sqrt{d}}{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}+B_{h}}\right)V$
(1)

Each stimulus consists of an $S$-token span presented $R$ times, for a total
stimulus length $T=SR$. Human and model top-1 accuracy for prompted word $i$
is denoted $P_{\text{human}}(\text{correct}_{i})$ and
$P_{\text{model}}(\text{correct}_{i})$, respectively, and $N_{i}$ is the
number of participants that responded to that prompt. Let
$B_{h}\in\mathbb{R}^{T\times T}$ be the additive bias for head $h$, and $H=12$
be the number of attention heads in each layer of GPT-2. We optimize over
$\\{B_{1},\dots,B_{H}\\}$ to minimize the mean squared error (MSE) between
$P_{\text{human}}(\text{correct})$ and $P_{\text{model}}(\text{correct})$,
weighted by the number of subjects who responded to each prompt ($N_{i}$). $W$
is the number of words that were prompted for at least one subject.

$\displaystyle\min_{\\{B_{1},\dots,B_{H}\\}}\frac{1}{W}\sum_{i=1}^{W}N_{i}\big{(}$
$\displaystyle P_{\text{human}}(\text{correct}_{i})-$ $\displaystyle
P_{\text{model}}(\text{correct}_{i})\big{)}^{2}$ (2)

What form should $B_{h}$ take? The model is superhuman in its long-distance
memory, so we sought to reduce the impact of long-distance attention by giving
the model a recency bias. Much earlier work has shown that human memory tends
to decay as a power law with time Donkin and Nosofsky (2012). A similar form
of decay is also seen in mutual information between words as a function of
their separation Lin and Tegmark (2017), and this has been previously
exploited in designing efficient language models Mahto et al. (2020). To
capture this type of behavior, we parameterized $B_{h}$ with
$\alpha_{h},\beta_{h}\in\mathbb{R}$:

$B_{h}=\sum_{k=0}^{T-1}\text{diag}_{k}(\alpha_{h}\cdot k^{-\exp(\beta_{h})})$
(3)

where $\text{diag}_{k}(d)$ constructs a $T\times T$ matrix that places the
scalar $d$ along the $k$-th diagonal below the main diagonal. Figure 4a shows
an example matrix with this form. This form of $B_{h}$ is advantageous because
the effect of $\alpha_{h},\beta_{h}$ can be evaluated on stimuli of any form
or length, including those that are non-repeating. We initialize
$\alpha_{h},\beta_{h}$ by sampling from a standard normal distribution.

We optimize the attention matrix biases $B_{h}$ to match human data from one
stimulus over 2000 epochs via gradient descent with the Adam optimizer Kingma
and Ba (2017), and then evaluated human-model similarity with the other four
stimuli. For each training stimulus, we repeated this procedure with five
initializations using different random seeds. We set the learning rate to
$5\text{\times}{10}^{-3}$.

###  6.1 Optimization results

Because the long-range copying behavior seems to initiate in layer 6 (Figure
3b), we began by only optimizing the attention bias for that layer.

We first examine the post-optimization timecourse of
$P_{\text{model}}(\text{correct})$ by averaging the held-out accuracies for a
single stimulus (Figure 4b). While the model’s predictions are largely
unchanged in the initial presentation, performance significantly deviates
toward human values in later presentations. This is summarized in Figure 4c,
where the model’s average performance within the later presentations is closer
to humans after optimization. Importantly, this optimization procedure
produces $B_{h}$ that generalize across stimuli because we do not fit on the
human data for the held-out stimulus.

Additionally, these $B_{h}$ generalize _within_ the stimulus. To measure
within-stimulus generalization, we randomly selected 30% of the prompts from
each presentation of the span and calculated the MSE on this subset separately
from the rest of the stimulus. Figure 4d shows the training and held-out
(validation) loss curves for the train stimulus, averaged across all five
stimuli and five random initializations. Training loss decreases on average
$52.9\%$, while validation loss decreases $40.4\%$; most of the improvement
for held-out prompts occurs in the first 1000 epochs.

We next examined the effects of the layer 6 intervention on the summarized
attention patterns of each layer, similar to Figure 3b. Figure 4e shows the
log-ratio of post- and pre-optimization probability mass for each attention
pattern, averaged across all held-out stimuli. The learned bias increases
attention on the current token at the expense of all other measured patterns
in layer 6, including (importantly) the induction pattern that would directly
copy the correct token from a previous presentation. Even though we only
intervened in layer 6, the induction pattern is weaker in all following
layers, and the model is attending more to the current and recent tokens.

Finally, we repeated the entire optimization procedure independently on each
layer and evaluated the change in human-LM correlation. We had hypothesized
that our intervention should only work to create human-like behavior when
applied to layers 6-12, which contained induction heads. However, the
intervention improved model-human correlation on repeated spans regardless of
the layer on which optimization was performed (Figure 4f, brown line). Effects
were strongest for layers 4-9, but small improvements were seen in every
layer. This might suggest that induction heads are not the only important
memory mechanism for this problem, or that the same effects can be achieved by
modifying the inputs to induction heads.

Our results show that the recency bias intervention was effective at rescuing
the divergence between human and model performance, but it is possible that
this improvement comes at the cost of much worse model performance in other
ways. For example, it could reduce the high correlation between human and
model in scenarios lacking short-term memory, or make the model worse overall
at next-word prediction. To test for the first effect, we computed the human-
model correlation for the first presentation of each held-out stimulus (Figure
4f, orange line). We found that the correlation did fall, but by a much
smaller amount than the correlation on subsequent presentations improved. For
example, in layer 6 human-model correlation on the first presentation
decreased by about 0.03, but the correlation on later presentations increased
by 0.2.

We also tested whether our intervention increased LM perplexity on an unseen
set of non-repeating text from the story corpus in order to measure how
general LM abilities change due to the intervention. No stories that were used
for fine-tuning or constructing the repeating stimuli were used to measure
perplexity. We computed the average perplexity for the modified and un-
modified model, and reported their ratio (Figure 4f, blue line). We found that
perplexity did increase due to the intervention, meaning that it generally
harmed next-word prediction performance. However, the degree of increase
varied substantially depending on which layer was modified, with the largest
effect found in layer 6 (a more than $40\%$ increase) and smaller effects in
the earliest and latest layers (roughly $10\%$ increase). This suggests that
at least part of the model’s general next-word prediction performance stems
from its superhuman recall, and not its ability to mimic human cognition.
Taking these three results together, we would suggest that the best layer to
modify actually appears to be layer 9, which yields the largest improvement in
human-model correlation with memory, a modest decline in human-model
correlation without memory, and only a roughly $15\%$ increase in overall
model perplexity.

##  7 Conclusions

Despite widely published results showing that human and LM prediction
performance is comparable, we have found a scenario wherein humans and GPT-2
show a substantial divergence. By examining the model’s attention maps for
non-initial presentations, we identify specific attention heads and layers
that attend across presentation boundaries to copy the next token. We finally
demonstrate a procedure that augments these heads’ attention maps with a
recency bias, disrupting their copying behavior. The intervention reliably
improves human-LM similarity across held-out stimuli in later presentations,
at the cost of increased perplexity.

With the behavioral data we collected, we have used an LM to build an explicit
model of human memory. Our findings here show that human memory has a stronger
recency bias than GPT-2, and in the future we hope to use this model to learn
more about human memory. Additionally, it suggests that attending over long
distances may result in diminishing returns—an alternate form of attention may
be able to exploit this phenomenon for increased efficiency.

Further work must be done to describe the change in model states during
repeated presentations of a stimulus. Characterizing this experiment as a test
of in-context learning (ICL), we may be able to exploit recent work Dai et al.
(2022) that suggests ICL is analogous to finetuning model weights.

## References

  * Amlund et al. (1986) Jeanne T. Amlund, Carol Anne M. Kardash, and Raymond W. Kulhavy. 1986.  Repetitive Reading and Recall of Expository Text.  _Reading Research Quarterly_ , 21(1):49–58.
  * Armeni et al. (2022) Kristijan Armeni, Christopher Honey, and Tal Linzen. 2022.  Characterizing Verbatim Short-Term Memory in Neural Language Models.
  * Baddeley (1992) Alan Baddeley. 1992.  Working memory.  _Science_ , 255(5044):556–559.
  * Baddeley and Ecob (1973) Alan D. Baddeley and Russell J. Ecob. 1973.  Reaction time and short-term memory: Implications of repetition effects for the high-speed exhaustive scan hypothesis.  _Quarterly Journal of Experimental Psychology_ , 25(2):229–240.
  * Bird et al. (2009) Steven Bird, Ewan Klein, and Edward Loper. 2009.  _Natural Language Processing with Python_.  O’Reilly Media.
  * Brown et al. (2020) Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020.  Language Models are Few-Shot Learners.  _arXiv:2005.14165 [cs]_.
  * Dai et al. (2022) Damai Dai, Yutao Sun, Li Dong, Yaru Hao, Zhifang Sui, and Furu Wei. 2022.  Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers.
  * Dai et al. (2019) Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. 2019.  Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context.  _arXiv:1901.02860 [cs, stat]_.
  * Dao et al. (2022) Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. 2022.  FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness.
  * Donkin and Nosofsky (2012) Chris Donkin and Robert M. Nosofsky. 2012.  A Power-Law Model of Psychological Memory Strength in Short-and Long-Term Recognition.  _Psychological Science_ , 23(6):625–634.
  * Elhage et al. (2021) Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. 2021.  A mathematical framework for transformer circuits.  _Transformer Circuits Thread_.
  * Goldstein et al. (2021) Ariel Goldstein, Zaid Zada, Eliav Buchnik, Mariano Schain, Amy Price, Bobbi Aubrey, Samuel A. Nastase, Amir Feder, Dotan Emanuel, Alon Cohen, Aren Jansen, Harshvardhan Gazula, Gina Choe, Aditi Rao, Se Catherine Kim, Colton Casto, Lora Fanda, Werner Doyle, Daniel Friedman, Patricia Dugan, Lucia Melloni, Roi Reichart, Sasha Devore, Adeen Flinker, Liat Hasenfratz, Omer Levy, Avinatan Hassidim, Michael Brenner, Yossi Matias, Kenneth A. Norman, Orrin Devinsky, and Uri Hasson. 2021.  Thinking ahead: Spontaneous prediction in context as a keystone of language in humans and machines.
  * Goodkind and Bicknell (2018) Adam Goodkind and Klinton Bicknell. 2018.  Predictive power of word surprisal for reading times is a linear function of language model quality.  In _Proceedings of the 8th Workshop on Cognitive Modeling and Computational Linguistics (CMCL 2018)_ , pages 10–18, Salt Lake City, Utah. Association for Computational Linguistics.
  * Hao et al. (2020) Yiding Hao, Simon Mendelsohn, Rachel Sterneck, Randi Martinez, and Robert Frank. 2020.  Probabilistic Predictions of People Perusing: Evaluating Metrics of Language Model Performance for Psycholinguistic Modeling.  In _Proceedings of the Workshop on Cognitive Modeling and Computational Linguistics_ , pages 75–86, Online. Association for Computational Linguistics.
  * Jacobs and McCarthy (2020) Cassandra L. Jacobs and Arya D. McCarthy. 2020.  The human unlikeness of neural language models in next-word prediction.  In _Proceedings of the The Fourth Widening Natural Language Processing Workshop_ , pages 115–115, Seattle, USA. Association for Computational Linguistics.
  * Jefferies et al. (2004) Elizabeth Jefferies, Matthew A. Lambon Ralph, and Alan D. Baddeley. 2004.  Automatic and controlled processing in sentence recall: The role of long-term and working memory.  _Journal of Memory and Language_ , 51(4):623–643.
  * Kingma and Ba (2017) Diederik P. Kingma and Jimmy Ba. 2017.  Adam: A Method for Stochastic Optimization.  _arXiv:1412.6980 [cs]_.
  * Kintsch (1965) Walter Kintsch. 1965.  The effects of repetition on the short-term memory function.  _Psychonomic Science_ , 2(1-12):149–150.
  * LeBel et al. (2023) Amanda LeBel, Lauren Wagner, Shailee Jain, Aneesh Adhikari-Desai, Bhavin Gupta, Allyson Morgenthal, Jerry Tang, Lixiang Xu, and Alexander G. Huth. 2023\.  A natural language fMRI dataset for voxelwise encoding models.  _Scientific Data_ , 10(1):555.
  * Lee et al. (2022) Mina Lee, Percy Liang, and Qian Yang. 2022.  CoAuthor: Designing a Human-AI Collaborative Writing Dataset for Exploring Language Model Capabilities.  In _Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems_ , CHI ’22, pages 1–19, New York, NY, USA. Association for Computing Machinery.
  * Lin and Tegmark (2017) Henry Lin and Max Tegmark. 2017.  Critical Behavior in Physics and Probabilistic Formal Languages.  _Entropy_ , 19(7):299.
  * Mahto et al. (2020) Shivangi Mahto, Vy Ai Vo, Javier S. Turek, and Alexander Huth. 2020.  Multi-timescale Representation Learning in LSTM Language Models.  In _International Conference on Learning Representations_.
  * Miles et al. (2006) T. R. Miles, Guillaume Thierry, Judith Roberts, and Josie Schiffeldrin. 2006.  Verbatim and gist recall of sentences by dyslexic and non-dyslexic adults.  _Dyslexia_ , 12(3):177–194.
  * Oh and Schuler (2023) Byung-Doh Oh and William Schuler. 2023.  Why Does Surprisal From Larger Transformer-Based Language Models Provide a Poorer Fit to Human Reading Times? _Transactions of the Association for Computational Linguistics_ , 11:336–350.
  * Olsson et al. (2022) Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. 2022\.  In-context Learning and Induction Heads.
  * Potter (1984) Mary C. Potter. 1984.  Rapid Serial Visual Presentation (RSVP): A Method for Studying Language Processing.  In _New Methods in Reading Comprehension Research_. Routledge.
  * Press et al. (2022) Ofir Press, Noah Smith, and Mike Lewis. 2022.  Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation.  In _International Conference on Learning Representations_.
  * Radford et al. (2019) Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019.  Language Models are Unsupervised Multitask Learners.  page 24.
  * Sennrich et al. (2016) Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016.  Neural Machine Translation of Rare Words with Subword Units.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 1715–1725, Berlin, Germany. Association for Computational Linguistics.
  * Tiedemann and Thottingal (2020) Jörg Tiedemann and Santhosh Thottingal. 2020.  OPUS-MT – Building open translation services for the World.  In _Proceedings of the 22nd Annual Conference of the European Association for Machine Translation_ , pages 479–480, Lisboa, Portugal. European Association for Machine Translation.
  * Tzeng (1973) Ovid J. L. Tzeng. 1973.  Positive recency effect in a delayed free recall.  _Journal of Verbal Learning and Verbal Behavior_ , 12(4):436–439.
  * Wilcox et al. (2020) Ethan Gotlieb Wilcox, Jon Gauthier, Jennifer Hu, Peng Qian, and Roger Levy. 2020\.  On the Predictive Power of Neural Language Models for Human Real-Time Comprehension Behavior.
  * Xie et al. (2022) Sang Michael Xie, Aditi Raghunathan, Percy Liang, and Tengyu Ma. 2022.  An Explanation of In-context Learning as Implicit Bayesian Inference.
  * Yang and Piantadosi (2022) Yuan Yang and Steven T. Piantadosi. 2022.  One model for the learning of language.  _Proceedings of the National Academy of Sciences_ , 119(5):e2021865119.

##  Appendix A Stimuli

Below are the stimuli in their entirety. Bolded words are those which at least
one subject is asked to predict, given the previous ten words. Presentation
boundaries are marked with //, but this token is never presented to the
subject or LM.

Stimulus 1 (3 presentations of a 65-word span):

we start to trade stories about our lives we’re both from up north we’re both
kind of newish to the neighborhood this is in florida we both went to college
not great colleges but man we graduated and i’m actually finding myself a
little jealous of her because she has this really cool job washing dogs she
had horses back home and she really loves // we start to trade stories about
our lives we’re both from up north we’re both kind of newish to the
neighborhood this is in florida we both went to college not great colleges but
man we graduated and i’m actually finding myself a little jealous of her
because she has this really cool job washing dogs she had horses back home and
she really loves // we start to trade stories about our lives we’re both from
up north we’re both kind of newish to the neighborhood this is in florida we
both went to college not great colleges but man we graduated and i’m actually
finding myself a little jealous of her because she has this really cool job
washing dogs she had horses back home and she really loves

Stimulus 2 (3 presentations of a 61-word span):

get out to the hamptons and we’re at this farmhouse and it was like a scene
out of christopher isherwood the berlin stories all these blonde boys about
ten of us running around doing push ups so that our muscles would swell and in
and out of the pool and a big buffet and everything waiting for the light to
change // get out to the hamptons and we’re at this farmhouse and it was like
a scene out of christopher isherwood the berlin stories all these blonde boys
about ten of us running around doing push ups so that our muscles would swell
and in and out of the pool and a big buffet and everything waiting for the
light to change // get out to the hamptons and we’re at this farmhouse and it
was like a scene out of christopher isherwood the berlin stories all these
blonde boys about ten of us running around doing push ups so that our muscles
would swell and in and out of the pool and a big buffet and everything waiting
for the light to change

Stimulus 3 (3 presentations of a 52-word span):

nine hours i find myself nine hours later back in the situation room looking
through the glass window at the operations people hoping this works when i see
people start cheering and erupting in cheers and excited and i hear alice
bowman’s voice over the intercom we are back on the prime // nine hours i find
myself nine hours later back in the situation room looking through the glass
window at the operations people hoping this works when i see people start
cheering and erupting in cheers and excited and i hear alice bowman’s voice
over the intercom we are back on the prime // nine hours i find myself nine
hours later back in the situation room looking through the glass window at the
operations people hoping this works when i see people start cheering and
erupting in cheers and excited and i hear alice bowman’s voice over the
intercom we are back on the prime

Stimulus 4 (2 presentations of a 107-word span):

year during the seventies my four aunts would take me and my two cousins on
their dream vacation a rented beach house in hyannis on the very cove sharing
beachfront with the kennedy compound every day for an entire week my aunt pat
would roll up her sisters’ hair my aunts would apply sunscreen to the back of
their necks the backs of the hands and the tops of their feet and then they
would drag their beach chairs down to the beach and they would set them up
perfectly not facing the water not into the sun for tanning but perfectly for
spying on the kennedys // year during the seventies my four aunts would take
me and my two cousins on their dream vacation a rented beach house in hyannis
on the very cove sharing beachfront with the kennedy compound every day for an
entire week my aunt pat would roll up her sisters’ hair my aunts would apply
sunscreen to the back of their necks the backs of the hands and the tops of
their feet and then they would drag their beach chairs down to the beach and
they would set them up perfectly not facing the water not into the sun for
tanning but perfectly for spying on the kennedys

Stimulus 5 (4 presentations of a 57-word span):

pastor was this forty something british guy and he really wanted to attract
twenty somethings so we were a hot commodity we were right in the demographic
and we started to get promoted up into higher and higher echelons of
leadership so we were invited to the leadership team meeting and then the core
leadership team meeting // pastor was this forty something british guy and he
really wanted to attract twenty somethings so we were a hot commodity we were
right in the demographic and we started to get promoted up into higher and
higher echelons of leadership so we were invited to the leadership team
meeting and then the core leadership team meeting // pastor was this forty
something british guy and he really wanted to attract twenty somethings so we
were a hot commodity we were right in the demographic and we started to get
promoted up into higher and higher echelons of leadership so we were invited
to the leadership team meeting and then the core leadership team meeting //
pastor was this forty something british guy and he really wanted to attract
twenty somethings so we were a hot commodity we were right in the demographic
and we started to get promoted up into higher and higher echelons of
leadership so we were invited to the leadership team meeting and then the core
leadership team meeting

##  Appendix B Additional GPT-2 experiments

Our human-LM comparisons were limited by the amount of data we could collect
from our behavioral experiment, but GPT-2 has no such limitation. We further
tested the LM on 100 random, non-phrase-aligned spans of text of different
lengths (10 to 570 words, in increments of 40) from the corpus of annotated
spoken narratives LeBel et al. (2023). For each text span, we form a stimulus
by repeating the span 15 times, or until the resulting text exceeds the
maximum input length of the model – in this case, 1024 tokens for GPT-2.

We feed each stimulus into the model and calculate the perplexity for every
token in the input. For each span length, we average the perplexity across the
100 random spans, yielding a single perplexity measure per token position. We
finally average the perplexity within the tokens of each presentation.

###  B.1 Results

Figure 5: Model results for GPT-2. (a) shows the average perplexity for each
presentation. (b) changes the x-axis to show the total number of tokens.

Figure 5 shows results for the repeated span experiment for GPT-2. GPT-2’s
perplexity on the initial presentation improves with longer spans. After only
a few presentations, however, the perplexity for GPT-2 quickly plateaus to
near-perfect performance. The model effectively memorizes the span, and has
learned when to regurgitate the previously seen tokens. These results confirm
the observations in Figure 2 on a significantly larger set of stimuli. For
smaller spans at higher repeats, though the mean perplexity across spans
remains stable with more presentations, the standard deviation increases
substantially.

These results extend the findings for LMs in Figure 2 to more presentations.


# On the structure theorem and the Maschke type theorem of Doi Hom-Hopf
modules

Shuang-jian Guo1 Xiao-hui Zhang2
1\. School of Mathematics and Statistics, Guizhou University of Finance and
Economics
Guiyang, 550025, P. R. China
2\. Department of Mathematics, Southeast University
Nanjing, 210096, P. R. China Corresponding author, email<EMAIL_ADDRESS>
Abstract We give necessary and sufficient conditions for the functor that
forgets the $(C,\gamma)$-coaction to be separable. This leads to a generalized
notion of integrals. Finally, the applications of our results are considered.

Keywords  Monoidal Hom-Hopf algebra; Doi Hom-Hopf module; separable functors;
normalized $(A,\beta)$-integral; Maschke type theorem.

MR(2010)Subject Classification 16T05

##  1 Introduction

The present paper investigates variations on the theme of Hom-algebras, a
topic which has recently received much attention from various researchers. The
study of Hom-associative algebras originates with work by Hartwig, Larsson and
Silvestrov in the Lie case [11], where a notion of Hom-Lie algebra was
introduced in the context of studying deformations of Witt and Virasoro
algebras. Later, it was extended to the associative case by Makhlouf and
Silverstrov in [13]. Now the associativity is replaced by Hom-associativity
$\alpha(a)(bc)=(ab)\alpha(c)$. Hom-coassociativity for a Hom-coalgebra can be
considered in a similar way, see [13]. Caenepeel etc. [1] studied Hom-
structures from the point of view of monoidal categories. This leads to the
natural definition of monoidal Hom-algebras, Hom-coalgebras, etc. They
constructed a symmetric monoidal category, and then introduced monoidal Hom-
algebras, Hom-coalgebras, etc. as algebras, coalgebras, etc. in this monoidal
category.

Let $H$ be a Hopf algebra with bijective antipode over a commutative ring $k$.
As is well-known, a Hopf module is a $k$-module that is at once an $H$-module
and an $H$-comodule, with a certain compatibility relation; see [17] for
details. Doi [7] generalized this concept in the following way: if $A$ is an
$H$-comodule algebra, and $C$ is an $H$-module coalgebra, then he introduced a
so-called unified Hopf module: this is a $k$-module that is at once an
$A$-module and a $C$-comodule, satisfying a compatibility relation that is an
immediate generalization of the one that may be found in Sweedler’s book [17].
One of the nice features here is that Doi’s Hopf modules (we will call them
Doi-Hopf modules) really unify a lot of module structures that have been
studied by several authors; let us mention Sweedler’s Hopf modules [17],
Takeuchi’s relative Hopf modules [18], graded modules, and modules graded by a
$G$-set. In [7], induction functors between categories of Doi-Hopf modules and
their adjoints are studied, and it turns out that many pairs of adjoint
functors studied in the literature (the forgetful functor and its adjoint,
extension and restriction of scalars,…) are special cases. Caenepeel etc. [2]
proved a Maschke type theorem for the category of Doi-Hopf modules. In fact,
they gave necessary and sufficient conditions for the functor that forgets the
$H$-coaction to be separable. This leads to a generalized notion of integrals
of Doi [6].

The following questions arise naturally:

1\. How do we introduce the notion of a Doi Hom-Hopf module?

2\. The evident functor $F$ from the category of Doi Hom-Hopf modules to the
category of modules over the Hom algebra $A$, does it possess a right adjoint?
What is a sufficient and necessary condition for its separability?

3\. How do we give a Maschke type theorem for Doi Hom-Hopf modules? The aim of
this article is to give a positive answer to these questions.

In this paper we study the generalization of the previous results to the
monoidal Hom-Hopf algebras. In Sec.3, we introduce the notion of a Doi Hom-
Hopf module and prove that the functor $F$ from the category of Doi Hom-Hopf
modules to the category of right $(A,\beta)$-Hom-modules has a right
adjoint(see Proposition 3.4). In Sec.4, we obtain the main result of this
paper. we give necessary and sufficient conditions for the functor that
forgets the $(C,\gamma)$-coaction to be separable (see Theorem 4.2). The
applications of our results are considered in Sec.5.

##  2 Preliminaries

Throughout this paper we work over a commutative ring $k$, we recall from [1]
some information about Hom-structures which are needed in what follows.

Let $\mathcal{C}$ be a category. We introduce a new category
$\widetilde{\mathscr{H}}(\mathcal{C})$ as follows: objects are couples
$(M,\mu)$, with $M\in\mathcal{C}$ and $\mu\in Aut_{\mathcal{C}}(M)$. A
morphism $f:(M,\mu)\rightarrow(N,\nu)$ is a morphism $f:M\rightarrow N$ in
$\mathcal{C}$ such that $\nu\circ f=f\circ\mu$.

Let $\mathscr{M}_{k}$ denotes the category of $k$-modules.
$\mathscr{H}(\mathscr{M}_{k})$ will be called the Hom-category associated to
$\mathscr{M}_{k}$. If $(M,\mu)\in\mathscr{M}_{k}$, then $\mu:M\rightarrow M$
is obviously a morphism in $\mathscr{H}(\mathscr{M}_{k})$. It is easy to show
that $\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ = (
$\mathscr{H}(\mathscr{M}_{k}),~{}\otimes,~{}(I,I),~{}\widetilde{a},~{}\widetilde{l},~{}\widetilde{r}))$
is a monoidal category by Proposition 1.1 in [1]: the tensor product of
$(M,\mu)$ and $(N,\nu)$ in $\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ is given
by the formula $(M,\mu)\otimes(N,\nu)=(M\otimes N,\mu\otimes\nu)$.

Assume that
$(M,\mu),(N,\nu),(P,\pi)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$. The
associativity and unit constraints are given by the formulas

$\displaystyle\widetilde{a}_{M,N,P}((m\otimes n)\otimes
p)=\mu(m)\otimes(n\otimes\pi^{-1}(p)),$
$\displaystyle\widetilde{l}_{M}(x\otimes m)=\widetilde{r}_{M}(m\otimes
x)=x\mu(m).$

An algebra in $\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ will be called a
monoidal Hom-algebra.

Definition 2.1. A monoidal Hom-algebra is an object is a triple
$(A,\alpha)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ together with a
$k$-linear map $m_{A}:A\otimes A\rightarrow A$ and an element $1_{A}\in A$
such that

$\displaystyle\alpha(ab)=\alpha(a)\alpha(b);~{}\alpha(1_{A})=1_{A},$
$\displaystyle\alpha(a)(bc)=(ab)\alpha(c);~{}a1_{A}=1_{A}a=\alpha(a),$

for all $a,b,c\in A$. Here we use the notation $m_{A}(a\otimes b)=ab$.

Definition 2.2. A monoidal Hom-coalgebra is an object
$(C,\gamma)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ together with
$k$-linear maps $\Delta:C\rightarrow C\otimes
C,~{}~{}~{}\Delta(c)=c_{(1)}\otimes c_{(2)}$ (summation implicitly understood)
and $\gamma:C\rightarrow C$ such that

$\displaystyle\Delta(\gamma(c))=\gamma(c_{(1)})\otimes\gamma(c_{(2)});~{}~{}~{}\varepsilon(\gamma(c))=\varepsilon(c),$

and

$\displaystyle\gamma^{-1}(c_{(1)})\otimes c_{(2)(1)}\otimes
c_{(2)(2)}=c_{(1)(1)}\otimes
c_{(1)(2)}\otimes\gamma^{-1}(c_{(2)}),~{}\varepsilon(c_{(1)})c_{(2)}=\varepsilon(c_{(2)})c_{(1)}=\gamma^{-1}(c)$

for all $c\in C$.

Definition 2.3. A monoidal Hom-bialgebra
$H=(H,\alpha,m,\eta,\Delta,\varepsilon)$ is a bialgebra in the symmetric
monoidal category $\widetilde{\mathscr{H}}(\mathscr{M}_{k})$. This means that
$(H,\alpha,m,\eta)$ is a Hom-algebra, $(H,\Delta,\alpha)$ is a Hom-coalgebra
and that $\Delta$ and $\varepsilon$ are morphisms of Hom-algebras that is,

$\displaystyle\Delta(ab)=a_{(1)}b_{(1)}\otimes
a_{(2)}b_{(2)};~{}~{}~{}\Delta(1_{H})=1_{H}\otimes 1_{H},$
$\displaystyle\varepsilon(ab)=\varepsilon(a)\varepsilon(b),~{}\varepsilon(1_{H})=1_{H}.$

Definition 2.4. A monoidal Hom-Hopf algebra is a monoidal Hom-bialgebra
$(H,\alpha)$ together with a linear map $S:H\rightarrow H$ in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ such that

$S\ast I=I\ast S=\eta\varepsilon,~{}S\alpha=\alpha S.$

Definition 2.5. Let $(A,\alpha)$ be a monoidal Hom-algebra. A right
$(A,\alpha)$\- Hom-module is an object
$(M,\mu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ consists of a $k$-module
and a linear map $\mu:M\rightarrow M$ together with a morphism $\psi:M\otimes
A\rightarrow M,\psi(m\cdot a)=m\cdot a$, in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ such that

$\displaystyle(m\cdot a)\cdot\alpha(b)=\mu(m)\cdot(ab);~{}~{}~{}~{}m\cdot
1_{A}=\mu(m),$

for all $a\in A$ and $m\in M$. The fact that
$\psi\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ means that

$\displaystyle\mu(m\cdot a)=\mu(m)\cdot\alpha(a).$

A morphism $f:(M,\mu)\rightarrow(N,\nu)$ in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ is called right $A$-linear if it
preserves the $A$-action, that is, $f(m\cdot a)=f(m)\cdot a$.
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$ will denote the category of
right $(A,\alpha)$-Hom-modules and $A$-linear morphisms.

Definition 2.6. Let $(C,\gamma)$ be a monoidal Hom-coalgebra. A right
$(C,\gamma)$-Hom-comodule is an object
$(M,\mu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ together with a
$k$-linear map $\rho_{M}:M\rightarrow M\otimes C$ notation
$\rho_{M}(m)=m_{[0]}\otimes m_{[1]}$ in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ such that

$\displaystyle
m_{[0][0]}\otimes(m_{[0][1]}\otimes\gamma^{-1}(m_{[1]}))=\mu^{-1}(m_{[0]})\otimes\Delta_{C}(m_{[1]});~{}m_{[0]}\varepsilon(m_{[1]})=\mu^{-1}(m),$

for all $m\in M$. The fact that
$\rho_{M}\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})$ means that

$\displaystyle\rho_{M}(\mu(m))=\mu(m_{[0]})\otimes\gamma(m_{[1]}).$

Morphisms of right $(C,\gamma)$-Hom-comodule are defined in the obvious way.
The category of right $(C,\gamma)$-Hom-comodules will be denoted by
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{C}$.

Theorem 2.7. (Rafael Theorem) Let $L:\mathcal{C}\rightarrow\mathcal{D}$ be the
left adjoint functor of $R:\mathcal{D}\rightarrow\mathcal{C}$. Then $L$ is a
separable functor if and only if the unit $\eta$ of the adjunction $(L,R)$ has
a natural retraction, i.e., there is a natural transformation
$\nu:RL\rightarrow id_{\mathcal{C}}$, such that $\nu\circ\eta=id$.

##  3 Adjoint functor

Definition 3.1. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra. A monoidal
Hom-algebra $(A,\beta)$ is called a right $(H,\alpha)$-Hom-comodule algebra if
$(A,\beta)$ is a right $(H,\alpha)$ Hom-comodule with coaction
$\rho_{A}:A\rightarrow A\otimes H,~{}~{}\rho_{A}(a)=a_{[0]}\otimes a_{[1]}$
such that the following conditions satisfy,

$\displaystyle\rho_{A}(ab)=a_{[0]}b_{[0]}\otimes a_{[1]}b_{[1]},$
$\displaystyle\rho_{A}(1_{A})=1_{A}\otimes 1_{H}.$

for all $a,b\in A$.

Definition 3.2. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra. A monoidal
Hom-coalgebra $(C,\gamma)$ is called a right $(H,\alpha)$ Hom-module
coalgebra, if $(C,\gamma)$ is a right $(H,\alpha)$ Hom-module with action
$\phi:C\otimes H\rightarrow C$, $\phi(c\otimes h)=c\cdot h$ such that the
following conditions satisfy:

$\displaystyle\Delta(c\cdot h)=c_{(1)}\cdot h_{(1)}\otimes c_{(2)}\cdot
h_{(2)},$ $\displaystyle\varepsilon(c\cdot h)=\varepsilon(c)\varepsilon(h),$

for all $c\in C$ and $g,h\in H$.

A Doi Hom-Hopf datum is a triple ($H,A,C$), where $H$ is a monoidal Hom-Hopf
algebra, $A$ a right $(H,\alpha)$-Hom comodule algebra and $(C,\gamma)$ a
right $(H,\alpha)$-Hom module coalgebra.

Definition 3.3. Given a Doi Hom-Hopf datum ($H,A,C$). A Doi Hom-Hopf module
$(M,\mu)$ is a right $(A,\beta)$-Hom-module which is also a right
$(C,\gamma)$-Hom-comodule with the coaction structure $\rho_{M}:M\rightarrow
M\otimes C$ defined by $\rho_{M}(m)=m_{[0]}\otimes m_{[1]}$ such that the
following compatible condition holds: for all $m\in M$ and $a\in A$,

$\displaystyle\rho_{M}(m\cdot a)=m_{[0]}\cdot a_{[0]}\otimes m_{[1]}a_{[1]}.$

A morphism between two right Doi Hom-Hopf modules is a $k$-linear map which is
a morphism in the categories $\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$
and $\widetilde{\mathscr{C}}(\mathscr{M}_{k})^{C}$ at the same time.
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$ will denote the category
of right Doi Hom-Hopf modules and morphisms between them.

Proposition 3.4. The forgetful functor
$F:\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$
has a right adjoint
$G:\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$.
$G$ is defined by

$G(M)=M\otimes C,$

with structure maps

$\displaystyle(m\otimes c)\cdot a=m\cdot a_{[0]}\otimes c\cdot a_{[1]},$
$\displaystyle\rho_{G(M)}(m\otimes c)=(\mu^{-1}(m)\otimes
c_{(1)})\otimes\gamma(c_{(2)}),$

for all $a\in A$ and $m\in M,c\in C$.

Proof. Let us first show that $G(M)$ is an object of
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$ . It is routine to check
that $G(M)$ is a right $(C,\gamma)$-Hom-comodule and a right $(A,\beta)$-Hom-
module. Now we only check the compatibility condition, for all $a\in A$ and
$c\in C$. Indeed,

$\displaystyle\rho_{G(M)}((m\otimes c)\cdot a)$ $\displaystyle=$
$\displaystyle\rho_{G(M)}(m\cdot a_{[0]}\otimes c\cdot a_{[1]})$
$\displaystyle=$ $\displaystyle\mu^{-1}(m)\cdot\beta^{-1}(a_{[0]})\otimes
c_{(1)}\cdot a_{[1](1)}\otimes\gamma(c_{(2)}\cdot a_{[1](2)})$
$\displaystyle=$ $\displaystyle\mu^{-1}(m)\cdot a_{[0][0]}\otimes c_{(1)}\cdot
a_{[0][1]}\otimes\gamma(c_{(2)})\cdot a_{[1]}$ $\displaystyle=$
$\displaystyle(m\otimes c)_{[0]}\cdot a_{[0]}\otimes(m\otimes c)_{[1]}\cdot
a_{[1]}$ $\displaystyle=$ $\displaystyle\rho_{G(M)}(m\otimes c)\cdot a.$

This is exactly what we have to show.

For an $A$-linear map $\varphi:(M,\mu)\rightarrow(N,\nu)$, we put

$G(\varphi)=\varphi\otimes id_{C}:M\otimes C\rightarrow N\otimes C.$

Standard computations show that $G(\varphi)$ is morphisms of right
$(A,\beta)$-Hom-modules and right $(C,\gamma)$-Hom-comodules. Let us describe
the unit $\eta$ and the counit $\delta$ of the adjunction. The unit is
described by the coaction: for
$(M,\mu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$, we define
$\eta_{M}:M\rightarrow M\otimes C$ as follows: for all $m\in M$,

$\eta_{M}(m)=m_{[0]}\otimes m_{[1]}.$

We can check that
$\eta_{M}\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$ . In fact,
for any $m\in M$, we have

$\displaystyle\eta_{M}(m\cdot a)$ $\displaystyle=$ $\displaystyle(m\cdot
a)_{[0]}\otimes(m\cdot a)_{[1]}$ $\displaystyle=$ $\displaystyle m_{[0]}\cdot
a_{[0]}\otimes m_{[1]}a_{[1]}$ $\displaystyle=$ $\displaystyle(m_{[0]}\otimes
m_{[1]})\cdot a=\eta_{M}(m)\cdot a,$

and

$\displaystyle\rho_{M\otimes C}\circ\eta_{M}(m)$ $\displaystyle=$
$\displaystyle\rho_{M\otimes C}(m_{[0]}\otimes m_{[1]})$ $\displaystyle=$
$\displaystyle(\mu^{-1}(m_{[0]})\otimes m_{[1](1)})\otimes\gamma(m_{[1](2)})$
$\displaystyle=$ $\displaystyle(m_{[0][0]}\otimes m_{[0][1]})\otimes m_{[1]}$
$\displaystyle=$ $\displaystyle(\eta_{M}\otimes id_{C})(m_{[0]}\otimes
m_{[1]})$ $\displaystyle=$ $\displaystyle(\eta_{M}\otimes
id_{C})\circ\rho_{M}(m).$

For any $(N,\nu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$, we define
$\delta_{N}:N\otimes C\rightarrow N$, for all $n\in N$ and $c\in C$,

$\delta_{N}(n\otimes c)=\varepsilon(c)\nu(n),$

we can check that $\delta_{N}$ is $(A,\beta)$-linear. In fact, for any $n\in
N$, we have

$\displaystyle\delta_{N}((n\otimes c)\cdot a)$ $\displaystyle=$
$\displaystyle\delta_{N}(n\cdot a_{[0]}\otimes c\cdot a_{[1]})$
$\displaystyle=$ $\displaystyle\varepsilon(c\cdot a_{[1]})\nu(n\cdot a_{[0]})$
$\displaystyle=$ $\displaystyle\varepsilon(c)\nu(n)\cdot a=\delta_{N}(n\otimes
c)\cdot a.$

This is what we need to show. We can check that $\eta$ and $\delta$ defined
above are all natural transformations and satisfied

$G(\delta_{N})\circ\eta_{G(N)}=I_{G(N)},$ $\delta_{F(M)}\circ
F(\eta_{M})=I_{F(M)},$

for all $(M,\mu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$ and
$(N,\nu)\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$ .

##  4 Separable functors for the category of Doi Hom-Hopf modules

In this section, we shall give necessary and sufficient conditions for the
functor $F$ which forget the $(C,\gamma)$-coaction to be separable.

Definition 4.1. Let ($H,A,C$) be a Doi Hom-Hopf datum. A $k$-linear map

$\theta:(C,\gamma)\otimes(C,\gamma)\rightarrow(A,\beta)$

such that $\theta\circ(\gamma\otimes\gamma)=\beta\circ\theta$ is called a
normalized $(A,\beta)$-integral, if $\theta$ satisfies the following
conditions:

(1) For all $c,d\in C$,

$\displaystyle\theta(\gamma^{-1}(d)\otimes c_{(1)})\otimes\gamma(c_{(2)})$ (4.
1) $\displaystyle=$
$\displaystyle\beta(\theta(d_{(2)}\otimes\gamma^{-1}(c))_{[0]})\otimes
d_{(1)}\cdot\theta(d_{(2)}\otimes\gamma^{-1}(c))_{[1]}.$

(2) For all $c\in C$,

$\theta(c_{(1)}\otimes c_{(2)})=1_{A}\varepsilon(c).$ (4. 2)

(3) For all $a\in A,c,d\in C$,

$\beta^{2}(a_{[0][0]})\theta(\gamma^{-1}(d)a_{[0][1]}\otimes\gamma^{-1}(c)\gamma^{-1}(a_{[1]}))=\theta(d\otimes
c)a.$ (4. 3)

Theorem 4.2. For any Doi Hom-Hopf datum ($H,A,C$), the following assertions
are equivalent,

(1) The left adjoint functor $F$ in Proposition 3.4 is separable,

(2) There exists a normalized $(A,\beta)$-integral
$\theta:(C,\gamma)\otimes(C,\gamma)\rightarrow(A,\beta)$.

Proof. $(2)\Longrightarrow(1)$. For any Doi Hom-Hopf module $M$, we define

$\displaystyle\nu_{M}:M\otimes C$ $\displaystyle\rightarrow$ $\displaystyle
M,$ $\displaystyle m\otimes c$ $\displaystyle\mapsto$
$\displaystyle\mu(m_{[0]})\theta(m_{[1]}\otimes\gamma^{-1}(c)),$

for all $m\in M$ and $c\in C$. Now, we shall check that
$\nu_{M}\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$. In fact, for
all $m\in M$, $c\in C$ and $a\in A$, it is easy to get that

$\nu_{M}(\mu(m)\otimes\gamma(c))=\mu(\nu_{M}(m\otimes c)).$

We also have

$\displaystyle\nu_{M}((m\otimes c)\cdot a)$ $\displaystyle=$
$\displaystyle\nu_{M}(m\cdot a_{[0]}\otimes c\cdot a_{[1]})$ $\displaystyle=$
$\displaystyle(\mu(m_{[0]})\cdot\beta(a_{[0][0]}))\theta(m_{[1]}a_{[0][1]}\otimes\gamma^{-1}(c)\cdot\alpha^{-1}(a_{[1]}))$
$\displaystyle=$
$\displaystyle\mu^{2}(m_{[0]})\cdot(\beta(a_{[0][0]})\beta^{-1}(\theta(m_{[1]}a_{[0][1]}\otimes\gamma^{-1}(c)\cdot\alpha^{-1}(a_{[1]})))$
$\displaystyle=$
$\displaystyle\mu^{2}(m_{[0]})\cdot(\beta(a_{[0][0]})\theta(\gamma^{-1}(m_{[1]})\gamma^{-1}(a_{[0][1]})\otimes\gamma^{-2}(c)\cdot\alpha^{-2}(a_{[1]})))$
$\displaystyle\stackrel{{\scriptstyle(4.3)}}{{=}}$
$\displaystyle\mu^{2}(m_{[0]})\cdot(\theta(m_{[1]}\otimes\gamma^{-1}(c))\cdot\beta^{-1}(a))$
$\displaystyle=$
$\displaystyle(\mu(m_{[0]})\cdot\theta(m_{[1]}\otimes\gamma^{-1}(c)))\cdot a$
$\displaystyle=$ $\displaystyle(\nu_{M}(m\otimes c))\cdot a.$

Hence it is a morphism of $(A,\beta)$-Hom-modules. Next, we shall check that
$\nu_{M}$ is a morphism of comodules over $(C,\gamma)$. It is sufficient to
check that

$\rho_{M}\circ\nu_{M}=(\nu_{M}\otimes id_{C})\circ\rho_{M}$

holds. For all $m\in M$ and $c\in C$, we have

$\displaystyle\rho_{M}\circ\nu_{M}(m\otimes c)$ $\displaystyle=$
$\displaystyle\rho_{M}(\mu(m_{[0]})\theta(m_{[1]}\otimes\gamma^{-1}(c)))$
$\displaystyle=$
$\displaystyle(\mu(m_{[0]})\cdot\theta(m_{[1]}\otimes\gamma^{-1}(c))_{[0]}\otimes(\mu(m_{[0]})\cdot\theta(m_{[1]}\otimes\gamma^{-1}(c)))_{[1]}$
$\displaystyle=$
$\displaystyle\mu(m_{[0][0]})\cdot\theta(m_{[1]}\otimes\gamma^{-1}(c))_{[0]}\otimes\gamma(m_{[0][1]})\cdot\theta(m_{(1)}\otimes\gamma^{-1}(c))_{[1]}$
$\displaystyle=$ $\displaystyle
m_{[0]}\cdot\theta(\gamma(m_{[1](2)})\otimes\gamma^{-1}(c))_{[0]}\otimes\gamma(m_{[1](1)})\cdot\theta(\gamma(m_{[1](2)})\otimes\gamma^{-1}(c))_{[1]}$
$\displaystyle\stackrel{{\scriptstyle(4.1)}}{{=}}$ $\displaystyle
m_{[0]}\cdot\beta^{-1}(\theta(m_{[1]}\otimes c_{(1)}))\otimes\gamma(c_{(2)})$
$\displaystyle=$ $\displaystyle
m_{[0]}\cdot\theta(\gamma^{-1}(m_{[1]})\otimes\gamma^{-1}(c_{(1)}))\otimes\gamma(c_{(2)})$
$\displaystyle=$ $\displaystyle(\nu_{M}\otimes id_{C})\circ\rho_{M}(m\otimes
c).$

For all $m\in M$, since

$\displaystyle\nu_{M}\circ\eta_{M}(m)$ $\displaystyle=$
$\displaystyle\nu_{M}(m_{[0]}\otimes m_{[1]})$ $\displaystyle=$
$\displaystyle\mu(m_{[0][0]})\cdot\theta(m_{[0][1]}\otimes\gamma^{-1}(m_{[1]}))$
$\displaystyle=$ $\displaystyle m_{[0]}\cdot\theta(m_{[1](1)}\otimes
m_{[1](2)})\stackrel{{\scriptstyle(4.2)}}{{=}}m.$

So the left adjoint $F$ in Proposition 3.4 is separable follows by Rafael
theorem (see [16] for detail).

$(1)\Longrightarrow(2)$. We consider the following Doi Hom-Hopf module
$A\otimes C$, and the $(A,\beta)$-actions and $(C,\gamma)$-coaction are
defined as follows:

$\left\\{\begin{array}[]{ll}(a\otimes c)\cdot b=ab_{[0]}\otimes c\cdot
b_{[1]};\\\ \rho_{A\otimes C}(a\otimes c)=(\beta^{-1}(a)\otimes
c_{(1)})\otimes\gamma(c_{(2)}),\end{array}\right.$

for any $a,b\in A$ and $c\in C$.

Evaluating at this object, the retraction $\nu$ of the unit of the adjunction
in Proposition 3.4 yields a morphism

$\nu_{A\otimes C}:(A\otimes C)\otimes C\rightarrow A\otimes C$

such that, for all $a\in A,c\in C$,

$\nu_{A\otimes C}((a\otimes c_{(1)})\otimes c_{(2)})=\beta(a)\otimes c.$

It can be used to construct $\theta$ as follows:

$\theta:C\otimes C\rightarrow A,$ $\theta(c\otimes
d)=r_{A}(id_{A}\otimes\varepsilon_{C})\nu_{A\otimes C}((1_{A}\otimes c)\otimes
d),$

where $r$ means the right unit constraint. For all $c\in C$, since

$\displaystyle\theta(c_{(1)}\otimes c_{(2)})$ $\displaystyle=$ $\displaystyle
r_{A}(id_{A}\otimes\varepsilon_{C})\nu_{A\otimes C}((1_{A}\otimes
c_{(1)})\otimes c_{(2)})$ $\displaystyle=$ $\displaystyle
r_{A}(id_{A}\otimes\varepsilon_{C})(1_{A}\otimes c)=1_{A}\varepsilon_{C}(c).$

Hence condition Eq.(4.2) follows. It can be seen to obey Eq.(4.3) by
naturality and the $(A,\beta)$-Hom module map property of $\nu$.

The verification of Eq.(4.1) is more involved. For any right
$(C,\gamma)$-comodule $M$, we consider the Doi Hom-Hopf module $M\otimes A$,
the $(A,\beta)$-action and $(C,\gamma)$-coaction are defined as follows: for
all $m\in M$ and $a,b\in A$,

$\left\\{\begin{array}[]{ll}(m\otimes a)\cdot b=\mu^{-1}(m)\otimes
a\beta(b),\\\ \rho_{M\otimes A}(m\otimes a)=(m_{[0]}\otimes a_{[0]})\otimes
m_{[1]}\cdot a_{[1]}.\end{array}\right.$

In particular, there is a Doi Hom-Hopf module $C\otimes A$ and the map

$\xi:C\otimes A\rightarrow A\otimes C\ $ $\xi(c\otimes
a)=\beta(a_{[0]})\otimes\gamma^{-1}(c)\cdot a_{[1]}.$

Since $\xi$ is both right $(A,\beta)$-linear and right $(C,\gamma)$-colinear,
thus we have

$\displaystyle\xi(\nu_{C\otimes A}((c\otimes a)\otimes d))$ $\displaystyle=$
$\displaystyle\nu_{A\otimes C}((\xi\otimes id_{C})((c\otimes a)\otimes d))$
(4. 4) $\displaystyle=$ $\displaystyle\nu_{A\otimes
C}((\beta(a_{[0]})\otimes\gamma^{-1}(c)\cdot a_{[1]})\otimes d).$

It is not hard to check that $GF(C\otimes A)=(C\otimes A)\otimes
C\in{}^{C}\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{C}_{A}$, and its left
$(C,\gamma)$-Hom comodule structure is given by

$(c\otimes a)\otimes
d\mapsto\alpha(c_{(1)})\otimes((c_{(2)}\otimes\beta^{-1}(a))\otimes\gamma^{-1}(d)).$

Also $C\otimes A\in{}^{C}\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{C}_{A}$,
and the left $(C,\gamma)$-coaction of $C\otimes A$ is given by

$c\otimes a\mapsto\gamma(c_{(1)})\otimes(c_{(2)}\otimes\beta^{-1}(a)).$

We also get $\nu_{C\otimes A}:(C\otimes A)\otimes C\rightarrow C\otimes A$ is
a morphism in ${}^{C}\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{C}_{A}$, which
means

$\displaystyle\nu_{C\otimes A}((c\otimes a)\otimes
d)_{[-1]}\otimes\nu_{C\otimes A}((c\otimes a)\otimes d)_{[0]}$
$\displaystyle~{}~{}~{}~{}~{}~{}~{}~{}=\gamma(c_{(1)})\otimes\nu_{C\otimes
A}((c_{(2)}\otimes\beta^{-1}(a))\otimes\gamma^{-1}(d)).$ (4. 5)

Thus we conclude that $\nu_{C\otimes A}$ is left and right
$(C,\gamma)$-colinear. Take $c,d\in C$, and put

$\nu_{A\otimes C}((1_{A}\otimes c)\otimes d)=\sum_{i}a_{i}\otimes q_{i}\in
A\otimes C,$ $\nu_{C\otimes A}((h\otimes 1_{A})\otimes g)=\sum_{i}p_{i}\otimes
b_{i}\in C\otimes A,$

we obtain

$\displaystyle\beta(\theta(c_{(2)}\otimes\gamma^{-1}(d))_{[0]})\otimes
c_{(1)}\theta(c_{(2)}\otimes\gamma^{-1}(d))_{[1]}$ $\displaystyle=$
$\displaystyle\beta(r_{A}(id_{A}\otimes\varepsilon_{C})\nu_{A\otimes
C}((1_{A}\otimes c_{(2)})\otimes\gamma^{-1}(d))_{[0]})\otimes c_{(1)}$
$\displaystyle\cdot(r_{A}(id_{A}\otimes\varepsilon_{C})\nu_{A\otimes
C}((1_{A}\otimes c_{(2)})\otimes\gamma^{-1}(d)))_{[1]}$
$\displaystyle\stackrel{{\scriptstyle(4.4)}}{{=}}$
$\displaystyle\beta(r_{A}(id_{A}\otimes\varepsilon_{C})\xi\nu_{C\otimes
A}((c_{(2)}\otimes 1_{A})\otimes\gamma^{-1}(d))_{[0]})\otimes c_{(1)}$
$\displaystyle\cdot(r_{A}(id_{A}\otimes\varepsilon_{C})\xi\nu_{C\otimes
A}((c_{(2)}\otimes 1_{A})\otimes\gamma^{-1}(d))_{[1]})$
$\displaystyle\stackrel{{\scriptstyle(4.5)}}{{=}}$
$\displaystyle\sum_{i}\beta({r_{A}(id_{A}\otimes\varepsilon_{C})\xi({p_{i}}_{(2)}\otimes\beta^{-1}(b_{i}))}_{[0]})\otimes{p_{i}}_{(1)}({r_{A}(id_{A}\otimes\varepsilon_{C})\xi({p_{i}}_{(2)}\otimes\beta^{-1}(b_{i}))}_{[1]})$
$\displaystyle=$
$\displaystyle\sum_{i}\beta(r_{A}(id_{A}\otimes\varepsilon_{C})({b_{i}}_{[0]}\otimes\gamma^{-1}({p_{i}}_{(2)}){b_{i}}_{[1]})_{[0]})\otimes{p_{i}}_{(1)}(r_{A}(id_{A}\otimes\varepsilon_{C})({b_{i}}_{[0]}\otimes\gamma^{-1}({p_{i}}_{(2)}){b_{i}}_{[1]})_{[1]})$
$\displaystyle=$
$\displaystyle\sum_{i}\beta({b_{i}}_{[0]})\otimes{p_{i}}_{(1)}\varepsilon_{C}({p_{i}}_{(2)})({b_{i}}_{[1]})$
$\displaystyle=$ $\displaystyle\sum_{i}\xi(p_{i}\otimes
b_{i})=\xi(\nu_{C\otimes A}((h\otimes 1_{A})\otimes g)).$

Use the fact that $\nu_{A\otimes C}$ is a morphism of right $(C,\gamma)$-Hom
comodules, we also have

$\displaystyle\theta(\alpha^{-1}(c)\otimes d_{(1)})\otimes\gamma(d_{(2)})$
$\displaystyle=$ $\displaystyle
r_{A}(id_{A}\otimes\varepsilon_{C})\nu_{A\otimes
C}((1_{A}\otimes\gamma^{-1}(c))\otimes d_{(1)})\otimes\gamma(d_{(2)})$
$\displaystyle=$
$\displaystyle\sum_{i}r_{A}(id_{A}\otimes\varepsilon_{C})(\beta^{-1}(a_{i})\otimes{q_{i}}_{(1)})\otimes\gamma({q_{i}}_{(2)})$
$\displaystyle=$ $\displaystyle\sum_{i}a_{i}\otimes q_{i}=\nu_{A\otimes
C}((1_{A}\otimes c)\otimes d)$
$\displaystyle\stackrel{{\scriptstyle(4.4)}}{{=}}$
$\displaystyle\xi(\nu_{C\otimes A}((c\otimes 1_{A})\otimes d)).$

Hence, we can get condition Eq.(4.1).

##  5 Applications

###  5.1 A Maschke type theorem for Doi Hom-Hopf modules

Since separable functors reflect well the semisimplicity of the objects of a
categogy, by Theroem 4.2, we will prove a Maschke type theorem for Doi Hom-
Hopf modules as an application.

Corollary 5.1. Let $(H,A,C)$ be a Doi Hom-Hopf datum, and
$M,N\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$. Suppose that
there exists a normalized $(A,\beta)$-integral
$\theta:(C,\gamma)\otimes(C,\gamma)\rightarrow(A,\beta)$. Then a monomorphism
(resp. epimorphism) $f:(M,\mu)\rightarrow(N,\nu)$ splits in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{C}_{A}$, if the monomorphism
(resp. epimorphism) $f$ splits as an $(A,\beta)$-module morphism.

###  5.2  Relative Hom-Hopf modules

Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra and $(A,\beta)$ a right
$(H,\alpha)$-Hom-comodule algebra. Then the triple $(H,A,H)$ is a Doi-Hom Hopf
datum. The category $\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H)^{H}_{A}$ is
called an $(H,A)$-Hom-Hopf module category and denoted by
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{H}_{A}$.

Corollary 5.2. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra and $(A,\beta)$
a right $(H,\alpha)$-Hom-comodule algebra. Then the following statements are
equivalent:

(1) The forgetful functor
$F:\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{H}_{A}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{A}$
is separable,

(2) There exists a normalized $(A,\beta)$-integral
$\theta:(H,\alpha)\otimes(H,\alpha)\rightarrow(A,\beta)$.

###  5.3  Hom-Yetter-Drinfeld modules

First, we give the definition of Yetter-Drinfeld modules over a monoidal Hom-
Hopf algebra, which is also introduced by Liu and Shen in [12] similarly.

Definition 5.3. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra. A right-right
$(H,\alpha)$-Hom-Yetter- Drinfeld module is an object $(M,\beta)$ in
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})$, such that $(M,\beta)$ a right
$(H,\alpha)$-Hom-module and a right $(H,\alpha)$-Hom-comodule with the
following compatibility condition:

$\displaystyle m_{[0]}\cdot h_{(1)}\otimes m_{[1]}\cdot
h_{(2)}=\mu((\mu^{-1}(m)\cdot h_{(2)})_{[0]})\otimes h_{(1)}(\mu^{-1}(m)\cdot
h_{(2)})_{[1]}$ (5. 1)

for all $h\in H$ and $m\in M$. We denote by $\mathscr{HYD}_{H}^{H}$ the
category of right-right $(H,\alpha)$-Hom-Yetter-Drinfeld modules, morphisms
being right $(H,\alpha)$-linear right $(H,\alpha)$-colinear maps.

Poposition 5.4. One has that Eq. (5.1) is equivalent to the following
equation:

$\displaystyle\rho(m\cdot h)=m_{[0]}\cdot\alpha(h_{(2)(1)})\otimes
S(h_{(1)})(\alpha^{-1}(m_{[1]})h_{(2)(2)}),$

for all $h\in H$ and $m\in M$.

Proof. Similar to [12].

Theorem 5.5. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra with bijective
antipode.

(1) $H$ can be made into a right $H^{op}\otimes H$-Hom-comodule algebra. The
coaction $H\rightarrow H\otimes(H^{op}\otimes H)$ is given by the formula

$\displaystyle h\mapsto\alpha(h_{(2)(1)})\otimes(h_{(2)(2)}\otimes
S(\alpha^{-1}(h_{(1)}))).$

(2) $H$ can be made into a right $H^{op}\otimes H$-Hom module coalgebra. The
action of $H^{op}\otimes H$ on $H$ is given by the formula

$\displaystyle c\triangleleft(h\otimes k)=\alpha(k)(\alpha^{-1}(c)h).$

(3) The category $\mathscr{HYD}_{H}^{H}$ of right-right Hom-Yetter-Drinfeld
modules is isomorphic to a category of Doi Hom-Hopf modules, namely
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H^{op}\otimes H)^{H}_{H}$.

Proof. (1) Let us first prove that $H$ is a right $H^{op}\otimes H$-Hom
comodule. For all $h\in H$,

$\displaystyle(\alpha^{-1}\otimes\Delta_{H^{op}\otimes H})\rho_{H}(h)$
$\displaystyle=$ $\displaystyle h_{(2)(1)}\otimes\Delta_{H^{op}\otimes
H}(h_{(2)(2)}\otimes S(\alpha^{-1}(h_{(1)})))$ $\displaystyle=$ $\displaystyle
h_{(2)(1)}\otimes h_{(2)(2)(1)}\otimes S(\alpha^{-1}(h_{(1)(2)}))\otimes
h_{(2)(2)(2)}\otimes S^{-1}(\alpha^{-1}(h_{(1)(1)}))$ $\displaystyle=$
$\displaystyle\alpha(h_{(2)(1)(1)})\otimes h_{(2)(1)(2)}\otimes
S(\alpha^{-1}(h_{(1)(2)}))\otimes\alpha^{-1}(h_{(2)(2)})\otimes
S(\alpha^{-1}(h_{(1)(1)}))$ $\displaystyle=$
$\displaystyle\alpha^{2}(h_{(2)(2)(1)(1)})\otimes\alpha(h_{(2)(2)(1)(2)})\otimes
S(\alpha^{-1}(h_{(2)(1)}))\otimes h_{(2)(2)(2)}\otimes
S(\alpha^{-2}(h_{(1)}))$ $\displaystyle=$
$\displaystyle\alpha^{2}(h_{(2)(1)(2)(1)})\otimes\alpha(h_{(2)(1)(2)(2)})\otimes
S(h_{(2)(1)(1)})\otimes\alpha^{-1}(h_{(2)(2)})\otimes
S^{-1}(\alpha^{-2}(h_{(1)}))$ $\displaystyle=$
$\displaystyle\rho(\alpha(h_{(2)(1)}))\otimes\alpha^{-1}(h_{(2)(2)})\otimes
S(\alpha^{-2}(h_{(1)}))$ $\displaystyle=$
$\displaystyle(\rho_{H}\otimes\alpha^{-1})\rho_{H}(h)$

and therefore $H$ is a right $H^{op}\otimes H$-Hom comodule.

We also have that

$\displaystyle\rho(hg)$ $\displaystyle=$
$\displaystyle\alpha(h_{(2)(1)}g_{(2)(1)})\otimes(h_{(2)(2)}g_{(2)(2)}\otimes
S(\alpha^{-1}(h_{(1)}g_{(1)}))\otimes)$ $\displaystyle=$
$\displaystyle\alpha(h_{(2)(1)})\alpha(g_{(2)(1)})\otimes(g_{(2)(2)}h_{(2)(2)}\otimes
S(\alpha^{-1}(g_{(1)}))S(\alpha^{-1}(h_{(1)})))$ $\displaystyle=$
$\displaystyle(\alpha(h_{(2)(1)})\otimes(h_{(2)(2)}\otimes
S(\alpha^{-1}(h_{(1)}))))(\alpha(g_{(2)(1)})\otimes(g_{(2)(2)}\otimes
S(\alpha^{-1}(g_{(1)}))))$ $\displaystyle=$
$\displaystyle\rho_{H}(h)\rho_{H}(g)$

(2) We will first prove that $H$ is a $H^{op}\otimes H$-Hom comodule. For all
$h,l,k,m,c\in H$, we have that

$\displaystyle[c\triangleleft(h\otimes
k)]\triangleleft(\alpha(l)\otimes\alpha(m))$ $\displaystyle=$
$\displaystyle[\alpha(k)(\alpha^{-1}(c)h)]\triangleleft(\alpha(l)\otimes\alpha(m))$
$\displaystyle=$
$\displaystyle\alpha^{2}(m)[[k(\alpha^{-2}(c)\alpha^{-1}(h))]\alpha(l)]$
$\displaystyle=$
$\displaystyle\alpha^{2}(m)[[(\alpha^{-1}(k)\alpha^{-2}(c))h]\alpha(l)]$
$\displaystyle=$ $\displaystyle\alpha^{2}(m)[(k\alpha^{-1}(c))(hl)]$
$\displaystyle=$ $\displaystyle[c(mk)](\alpha(h)\alpha(l))$ $\displaystyle=$
$\displaystyle\alpha(c)\triangleleft(hl\otimes
mk)=\alpha(c)\triangleleft[(h\otimes k)(l\otimes m)],$

and this implies that $H$ is a $H^{op}\otimes H$-Hom comodule.

Using the fact that $(H,\alpha)$ is an $(H,\alpha)$-Hom-bimodule algebra, we
can obtain that that $(H,\alpha)$ is a left $H^{op}\otimes H$-Hom-module
coalgebra.

(3) Let $(M,\mu,\cdot,\rho_{M})$ be such that $(M,\cdot)$ is a right
$(H,\alpha)$-module and $(M,\rho_{M})$ is a right $(H,\alpha)$-comodule. Then
$M\in\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H^{op}\otimes H)^{H}_{H}$ if and
only if

$\displaystyle\rho_{M}(m\cdot h)$ $\displaystyle=$ $\displaystyle
m_{[0]}\cdot\alpha(h_{(2)(1)})\otimes m_{[1]}\triangleleft(h_{(2)(2)}\otimes
S(\alpha^{-1}(h_{(1)})))$ $\displaystyle=$ $\displaystyle
m_{[0]}\cdot\alpha(h_{(2)(1)})\otimes
S(h_{(1)})(\alpha^{-1}(m_{[1]})h_{(2)(2)})$

for all $h\in H$ and $m\in M$. This shows that
$\widetilde{\mathscr{H}}(\mathscr{M}_{k})(H^{op}\otimes H)^{H}_{H}$ is
isomorphic to $\mathscr{HYD}_{H}^{H}$.

From Theorem 4.2 we obtain immediately the following version of Maschke type
theorem for Hom Yetter-Drinfel’d modules:

Corollary 5.6. Let $(H,\alpha)$ be a monoidal Hom-Hopf algebra with bijective
antipode. Then the following statements are equivalent:

(1) The forgetful functor
$F:\mathscr{HYD}_{H}^{H}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{H}$
is separable,

(2) There exists a normalized $(H,\alpha)$-integral
$\theta:(H,\alpha)\otimes(H,\alpha)\rightarrow(H,\alpha)$.

###  5.4  Doi Hom-Hopf Datum $(k,k,H)$

Let $(H,\alpha)$ be a finite-dimensional monoidal Hom- Hopf algebra. Recall
from that [5] that $\varphi\in H^{\ast}$ is called a right integral on
$H^{\ast}$ if $\varphi\ast h^{\ast}=<h^{\ast},1_{H}>\varphi$ and
$\alpha^{\ast}\varphi=\varphi$ for all $h^{\ast}\in H^{\ast}$, or,
equivalently, if $\varphi:H\rightarrow k$ is right $(H,\alpha)$-colinear. Now
suppose that there exists a normalized $k$-integral
$\theta:(H,\alpha)\otimes(H,\alpha)\rightarrow k$. The map $\varphi$ defined
by $<\varphi,h>=\theta(1_{H}\otimes h)$ is a right integral. Conversely, if
$\varphi\in\int^{l}_{H\ast}$, the $k$-module consisting of classical integrals
on $(H,\alpha)$, then $\theta(h\otimes g)=\varphi(gS^{-1}(h))$ is a
$k$-integral. This can be proved directly.

Corollary 5.7. With the notations as above, then the following statements are
equivalent:

(1) The forgetful functor
$F:\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{H}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{k}$(the
category of all vector spaces) is separable.

(2)There exists a normalized $k$-integral
$\theta:(H,\alpha)\otimes(H,\alpha)\rightarrow k$ such that the following
conditions are satisfied:

$\alpha(h_{(2)})\theta(\alpha^{-1}(g)\otimes
h_{(1)})=g_{(1)}\theta(g_{(2)}\otimes\alpha^{-1}(h)).$ $\theta(h_{(1)}\otimes
h_{(2)})=\varepsilon_{H}(h).$

Corollary 5.8. Let $H$ be a finite dimensional cosemisimple monoidal Hom-Hopf
algebra. The forgetful functor
$F:\widetilde{\mathscr{H}}(\mathscr{M}_{k})^{H}\rightarrow\widetilde{\mathscr{H}}(\mathscr{M}_{k})_{k}$
is separable.

## Acknowledgements

The work is supported by the NSF of Jiangsu Province (No. BK2012736) and the
Fund of Science and Technology Department of Guizhou Province (No.
2014GZ81365).

## References

  * [1] S. Caenepeel and I. Goyvaerts, Monoidal Hom-Hopf algebras. Comm. Algebra  39(2011) 2216-2240.
  * [2] S. Caenepeel, G. Militaru, B. Ion and S. L. Zhu, Separable functors for the category of Doi-Hopf modules, Applications. Adv. Math. 145(1999) 239-290.
  * [3] S. Caenepeel, G. Militaru and S. L. Zhu, A Maschke type theorem for Doi- Hopf modules and applications. J. Algebra 187(1997) 388-412.
  * [4] S. Caenepeel, G. Militaru and S. L. Zhu, Crossed modules and Doi-Hopf modules. Israel J. Math. 100 (1997) 221-247.
  * [5] Y. Y. Chen, Z. W. Wang, and L. Y. Zhang, Integrals for monoidal Hom-Hopf algebras and their applications. J. Math. Phys.  54(2013) 073515.
  * [6] Y. Doi, Algebras with total integrals. Comm. Algebra 13(1985) 2137-2159.
  * [7] Y. Doi, Unifying Hopf-modules. J. Algebra 153(1992) 373-385.
  * [8] Y. Frégier and A. Gohr, On Hom type algebras. J. Gen. Lie Theory Appl. 4(2010) 16.
  * [9] Y. Frégier, A. Gohr and S. D. Silvestrov, Unital algebras of Hom-associative type and surjective or injective twistings. J. Gen. Lie Theory Appl. 3(2009) 285-295.
  * [10] A. Gohr, On Hom-algebras with surjective twisting. J. Algebra 324 (2010) 1483-1491.
  * [11] J. T. Hartwig, D. Larsson and S. D. Silvestrov, Deformations of Lie algebras using $\sigma$-derivations. J. Algebra 295(2006) 314-361.
  * [12] L. Liu and B. L. Shen, Radford’s biproducts and Yetter-Drinfeld modules for monoidal Hom-Hopf algebras. J. Math. Phys.  55(2014) 031701.
  * [13] A. Makhlouf and S. D. Silvestrov, Hom-algebra stuctures. J. Gen. Lie Theory Appl. 2(2008) 51-64.
  * [14] C. Năstăsescu, M. Van den Bergh and F. Van Oystaeyen, Separable functors applied to graded rings, J. Algebra 123(1989)397-413.
  * [15] A. Makhlouf and S. D. Silvestrov, Hom-algebras and Hom-coalgebras. J. Algebra Appl. 9(2010) 553-589.
  * [16] M. D. Rafael, Separable functors revised, Comm. Algebra 18(1990) 1445-1459.
  * [17] M. E. Sweedler, Hopf Algebras, New York: Benjamin, 1969.
  * [18] M. Takeuchi, Relative Hopf modules-equivalences and freeness criteria. J. Algebra 60(1979) 452-471.
  * [19] D. Yau, Enveloping algebras of Hom-Lie algebras. J. Gen. Lie Theory Appl. 2 (2008) 95-108.
  * [20] D. Yau, Hom-algebras and homology. J. Lie Theory 10(2009) 409-421.
  * [21] D. Yau, Hom-bialgebras and comodule algebras. Int. Electron. J. Algebra 8(2010) 45-64.